Top Description Inners Fields Constructors Methods
org.apache.avro.io

pack-priv Class DirectBinaryDecoder

extends BinaryDecoder
Class Inheritance
Imports
java.io.EOFException, .IOException, .InputStream, java.nio.ByteBuffer, org.apache.avro.InvalidNumberEncodingException, .SystemLimitException, org.apache.avro.util.ByteBufferInputStream

A non-buffering version of BinaryDecoder.

This implementation will not read-ahead from the provided InputStream beyond the minimum required to service the API requests.

See Also
Encoder

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class

Field Summary

Modifier and TypeField and Description
private final byte[]
private DirectBinaryDecoder.ByteReader
private InputStream

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv DirectBinaryDecoder
protected void
doReadBytes(byte[] bytes, int start, int length)

Overrides org.apache.avro.io.BinaryDecoder.doReadBytes.

Reads length bytes into bytes starting at start.
protected void
public InputStream
inputStream()

Overrides org.apache.avro.io.BinaryDecoder.inputStream.

Returns an java.io.InputStream that is aware of any buffering that may occur in this BinaryDecoder.
public boolean
isEnd()

Overrides org.apache.avro.io.BinaryDecoder.isEnd.

Returns true if the current BinaryDecoder is at the end of its source data and cannot read any further without throwing an EOFException or other IOException.
public boolean
public ByteBuffer
public double
public float
public int
readInt()

Overrides org.apache.avro.io.BinaryDecoder.readInt.

Reads an integer written by Encoder#writeInt.
public long
Inherited from org.apache.avro.io.BinaryDecoder:
arrayNextclearBufconfigureconfiguredoReadItemCountgetBufgetLimitgetPosmapNextreadArrayStartreadEnumreadFixedreadIndexreadMapStartreadNullreadStringreadStringsetBufskipArrayskipBytesskipFixedskipMapskipString

Field Detail

bufback to summary
private final byte[] buf

Hides org.apache.avro.io.BinaryDecoder.buf.

byteReaderback to summary
private DirectBinaryDecoder.ByteReader byteReader
inback to summary
private InputStream in

Constructor Detail

DirectBinaryDecoderback to summary
pack-priv DirectBinaryDecoder(InputStream in)

Method Detail

configureback to summary
pack-priv DirectBinaryDecoder configure(InputStream in)
doReadBytesback to summary
protected void doReadBytes(byte[] bytes, int start, int length) throws IOException

Overrides org.apache.avro.io.BinaryDecoder.doReadBytes.

Doc from org.apache.avro.io.BinaryDecoder.doReadBytes.

Reads length bytes into bytes starting at start.

Annotations
@Override
doSkipBytesback to summary
protected void doSkipBytes(long length) throws IOException

Overrides org.apache.avro.io.BinaryDecoder.doSkipBytes.

Annotations
@Override
inputStreamback to summary
public InputStream inputStream()

Overrides org.apache.avro.io.BinaryDecoder.inputStream.

Doc from org.apache.avro.io.BinaryDecoder.inputStream.

Returns an java.io.InputStream that is aware of any buffering that may occur in this BinaryDecoder. Readers that need to interleave decoding Avro data with other reads must access this InputStream to do so unless the implementation is 'direct' and does not read beyond the minimum bytes necessary from the source.

Annotations
@Override
isEndback to summary
public boolean isEnd() throws IOException

Overrides org.apache.avro.io.BinaryDecoder.isEnd.

Doc from org.apache.avro.io.BinaryDecoder.isEnd.

Returns true if the current BinaryDecoder is at the end of its source data and cannot read any further without throwing an EOFException or other IOException.

Not all implementations of BinaryDecoder support isEnd(). Implementations that do not support isEnd() will throw a java.lang.UnsupportedOperationException.

Annotations
@Override
Exceptions
IOException:
If the first byte cannot be read for any reason other than the end of the file, if the input stream has been closed, or if some other I/O error occurs.
readBooleanback to summary
public boolean readBoolean() throws IOException

Overrides org.apache.avro.io.BinaryDecoder.readBoolean.

Doc from org.apache.avro.io.Decoder.readBoolean.

Reads a boolean value written by Encoder#writeBoolean.

Annotations
@Override
readBytesback to summary
public ByteBuffer readBytes(ByteBuffer old) throws IOException

Overrides org.apache.avro.io.BinaryDecoder.readBytes.

Doc from org.apache.avro.io.Decoder.readBytes.

Reads a byte-string written by Encoder#writeBytes. if old is not null and has sufficient capacity to take in the bytes being read, the bytes are returned in old.

Annotations
@Override
readDoubleback to summary
public double readDouble() throws IOException

Overrides org.apache.avro.io.BinaryDecoder.readDouble.

Doc from org.apache.avro.io.Decoder.readDouble.

Reads a double written by Encoder#writeDouble.

Annotations
@Override
readFloatback to summary
public float readFloat() throws IOException

Overrides org.apache.avro.io.BinaryDecoder.readFloat.

Doc from org.apache.avro.io.Decoder.readFloat.

Reads a float written by Encoder#writeFloat.

Annotations
@Override
readIntback to summary
public int readInt() throws IOException

Overrides org.apache.avro.io.BinaryDecoder.readInt.

Doc from org.apache.avro.io.Decoder.readInt.

Reads an integer written by Encoder#writeInt.

Annotations
@Override
readLongback to summary
public long readLong() throws IOException

Overrides org.apache.avro.io.BinaryDecoder.readLong.

Doc from org.apache.avro.io.Decoder.readLong.

Reads a long written by Encoder#writeLong.

Annotations
@Override
org.apache.avro.io back to summary

private Class DirectBinaryDecoder.ByteReader

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.avro.io.DirectBinaryDecoder.ReuseByteReader

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public ByteBuffer
read(ByteBuffer old, int length)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ByteReaderback to summary
private ByteReader()

Method Detail

readback to summary
public ByteBuffer read(ByteBuffer old, int length) throws IOException
org.apache.avro.io back to summary

private Class DirectBinaryDecoder.ReuseByteReader

extends ByteReader
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final ByteBufferInputStream

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ByteBuffer

Field Detail

bbiback to summary
private final ByteBufferInputStream bbi

Constructor Detail

ReuseByteReaderback to summary
public ReuseByteReader(ByteBufferInputStream bbi)

Method Detail

readback to summary
public ByteBuffer read(ByteBuffer old, int length) throws IOException

Overrides org.apache.avro.io.DirectBinaryDecoder.ByteReader.read.

Annotations
@Override