org.apache.avro.io.JsonDecoder.checkFixed()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中org.apache.avro.io.JsonDecoder.checkFixed()方法的一些代码示例,展示了JsonDecoder.checkFixed()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonDecoder.checkFixed()方法的具体详情如下:
包路径:org.apache.avro.io.JsonDecoder
类名称:JsonDecoder
方法名:checkFixed

JsonDecoder.checkFixed介绍

暂无

代码示例

代码示例来源:origin: org.apache.avro/avro

  1. @Override
  2. public void skipFixed(int length) throws IOException {
  3. checkFixed(length);
  4. doSkipFixed(length);
  5. }

代码示例来源:origin: apache/avro

  1. @Override
  2. public void skipFixed(int length) throws IOException {
  3. checkFixed(length);
  4. doSkipFixed(length);
  5. }

代码示例来源:origin: apache/avro

  1. @Override
  2. public void readFixed(byte[] bytes, int start, int len) throws IOException {
  3. checkFixed(len);
  4. if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  5. byte[] result = readByteArray();
  6. in.nextToken();
  7. if (result.length != len) {
  8. throw new AvroTypeException("Expected fixed length " + len
  9. + ", but got" + result.length);
  10. }
  11. System.arraycopy(result, 0, bytes, start, len);
  12. } else {
  13. throw error("fixed");
  14. }
  15. }

代码示例来源:origin: org.apache.avro/avro

  1. @Override
  2. public void readFixed(byte[] bytes, int start, int len) throws IOException {
  3. checkFixed(len);
  4. if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  5. byte[] result = readByteArray();
  6. in.nextToken();
  7. if (result.length != len) {
  8. throw new AvroTypeException("Expected fixed length " + len
  9. + ", but got" + result.length);
  10. }
  11. System.arraycopy(result, 0, bytes, start, len);
  12. } else {
  13. throw error("fixed");
  14. }
  15. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.avro

  1. @Override
  2. public void skipFixed(int length) throws IOException {
  3. checkFixed(length);
  4. doSkipFixed(length);
  5. }

代码示例来源:origin: org.apache.hadoop/avro

  1. @Override
  2. public void skipFixed(int length) throws IOException {
  3. checkFixed(length);
  4. doSkipFixed(length);
  5. }

代码示例来源:origin: com.facebook.presto.hive/hive-apache

  1. @Override
  2. public void skipFixed(int length) throws IOException {
  3. checkFixed(length);
  4. doSkipFixed(length);
  5. }

代码示例来源:origin: org.apache.cassandra.deps/avro

  1. @Override
  2. public void skipFixed(int length) throws IOException {
  3. checkFixed(length);
  4. doSkipFixed(length);
  5. }

代码示例来源:origin: org.apache.hadoop/avro

  1. @Override
  2. public void readFixed(byte[] bytes, int start, int len) throws IOException {
  3. checkFixed(len);
  4. if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  5. byte[] result = readByteArray();
  6. in.nextToken();
  7. if (result.length != len) {
  8. throw new AvroTypeException("Expected fixed length " + len
  9. + ", but got" + result.length);
  10. }
  11. System.arraycopy(result, 0, bytes, start, len);
  12. } else {
  13. throw error("fixed");
  14. }
  15. }

代码示例来源:origin: com.facebook.presto.hive/hive-apache

  1. @Override
  2. public void readFixed(byte[] bytes, int start, int len) throws IOException {
  3. checkFixed(len);
  4. if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  5. byte[] result = readByteArray();
  6. in.nextToken();
  7. if (result.length != len) {
  8. throw new AvroTypeException("Expected fixed length " + len
  9. + ", but got" + result.length);
  10. }
  11. System.arraycopy(result, 0, bytes, start, len);
  12. } else {
  13. throw error("fixed");
  14. }
  15. }

代码示例来源:origin: org.apache.cassandra.deps/avro

  1. @Override
  2. public void readFixed(byte[] bytes, int start, int len) throws IOException {
  3. checkFixed(len);
  4. if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  5. byte[] result = readByteArray();
  6. in.nextToken();
  7. if (result.length != len) {
  8. throw new AvroTypeException("Expected fixed length " + len
  9. + ", but got" + result.length);
  10. }
  11. System.arraycopy(result, 0, bytes, start, len);
  12. } else {
  13. throw error("fixed");
  14. }
  15. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.avro

  1. @Override
  2. public void readFixed(byte[] bytes, int start, int len) throws IOException {
  3. checkFixed(len);
  4. if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  5. byte[] result = readByteArray();
  6. in.nextToken();
  7. if (result.length != len) {
  8. throw new AvroTypeException("Expected fixed length " + len
  9. + ", but got" + result.length);
  10. }
  11. System.arraycopy(result, 0, bytes, start, len);
  12. } else {
  13. throw error("fixed");
  14. }
  15. }

相关文章