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

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

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

JsonDecoder.readByteArray介绍

暂无

代码示例

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

@Override
public ByteBuffer readBytes(ByteBuffer old) throws IOException {
 advance(Symbol.BYTES);
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  return ByteBuffer.wrap(result);
 } else {
  throw error("bytes");
 }
}

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

private void doSkipFixed(int length) throws IOException {
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  if (result.length != length) {
   throw new AvroTypeException("Expected fixed length " + length
     + ", but got" + result.length);
  }
 } else {
  throw error("fixed");
 }
}

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

@Override
public void readFixed(byte[] bytes, int start, int len) throws IOException {
 checkFixed(len);
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  if (result.length != len) {
   throw new AvroTypeException("Expected fixed length " + len
     + ", but got" + result.length);
  }
  System.arraycopy(result, 0, bytes, start, len);
 } else {
  throw error("fixed");
 }
}

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

@Override
public ByteBuffer readBytes(ByteBuffer old) throws IOException {
 advance(Symbol.BYTES);
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  return ByteBuffer.wrap(result);
 } else {
  throw error("bytes");
 }
}

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

private void doSkipFixed(int length) throws IOException {
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  if (result.length != length) {
   throw new AvroTypeException("Expected fixed length " + length
     + ", but got" + result.length);
  }
 } else {
  throw error("fixed");
 }
}

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

@Override
public void readFixed(byte[] bytes, int start, int len) throws IOException {
 checkFixed(len);
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  if (result.length != len) {
   throw new AvroTypeException("Expected fixed length " + len
     + ", but got" + result.length);
  }
  System.arraycopy(result, 0, bytes, start, len);
 } else {
  throw error("fixed");
 }
}

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

@Override
public ByteBuffer readBytes(ByteBuffer old) throws IOException {
 advance(Symbol.BYTES);
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  return ByteBuffer.wrap(result);
 } else {
  throw error("bytes");
 }
}

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

@Override
public ByteBuffer readBytes(ByteBuffer old) throws IOException {
 advance(Symbol.BYTES);
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  return ByteBuffer.wrap(result);
 } else {
  throw error("bytes");
 }
}

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

@Override
public ByteBuffer readBytes(ByteBuffer old) throws IOException {
 advance(Symbol.BYTES);
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  return ByteBuffer.wrap(result);
 } else {
  throw error("bytes");
 }
}

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

@Override
public ByteBuffer readBytes(ByteBuffer old) throws IOException {
 advance(Symbol.BYTES);
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  return ByteBuffer.wrap(result);
 } else {
  throw error("bytes");
 }
}

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

private void doSkipFixed(int length) throws IOException {
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  if (result.length != length) {
   throw new AvroTypeException("Expected fixed length " + length
     + ", but got" + result.length);
  }
 } else {
  throw error("fixed");
 }
}

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

private void doSkipFixed(int length) throws IOException {
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  if (result.length != length) {
   throw new AvroTypeException("Expected fixed length " + length
     + ", but got" + result.length);
  }
 } else {
  throw error("fixed");
 }
}

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

private void doSkipFixed(int length) throws IOException {
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  if (result.length != length) {
   throw new AvroTypeException("Expected fixed length " + length
     + ", but got" + result.length);
  }
 } else {
  throw error("fixed");
 }
}

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

private void doSkipFixed(int length) throws IOException {
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  if (result.length != length) {
   throw new AvroTypeException("Expected fixed length " + length
     + ", but got" + result.length);
  }
 } else {
  throw error("fixed");
 }
}

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

@Override
public void readFixed(byte[] bytes, int start, int len) throws IOException {
 checkFixed(len);
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  if (result.length != len) {
   throw new AvroTypeException("Expected fixed length " + len
     + ", but got" + result.length);
  }
  System.arraycopy(result, 0, bytes, start, len);
 } else {
  throw error("fixed");
 }
}

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

@Override
public void readFixed(byte[] bytes, int start, int len) throws IOException {
 checkFixed(len);
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  if (result.length != len) {
   throw new AvroTypeException("Expected fixed length " + len
     + ", but got" + result.length);
  }
  System.arraycopy(result, 0, bytes, start, len);
 } else {
  throw error("fixed");
 }
}

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

@Override
public void readFixed(byte[] bytes, int start, int len) throws IOException {
 checkFixed(len);
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  if (result.length != len) {
   throw new AvroTypeException("Expected fixed length " + len
     + ", but got" + result.length);
  }
  System.arraycopy(result, 0, bytes, start, len);
 } else {
  throw error("fixed");
 }
}

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

@Override
public void readFixed(byte[] bytes, int start, int len) throws IOException {
 checkFixed(len);
 if (in.getCurrentToken() == JsonToken.VALUE_STRING) {
  byte[] result = readByteArray();
  in.nextToken();
  if (result.length != len) {
   throw new AvroTypeException("Expected fixed length " + len
     + ", but got" + result.length);
  }
  System.arraycopy(result, 0, bytes, start, len);
 } else {
  throw error("fixed");
 }
}

相关文章