|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avro.io.Encoder org.apache.avro.io.BinaryEncoder org.apache.avro.io.BufferedBinaryEncoder
public class BufferedBinaryEncoder
An Encoder
for Avro's binary encoding.
DirectBinaryEncoder
can be used in place of this implementation if
the buffering semantics are not desired, and the performance difference
is acceptable.
To construct or reconfigure, use
EncoderFactory.binaryEncoder(OutputStream, BinaryEncoder)
.
To change the buffer size, configure the factory instance used to
create instances with EncoderFactory.configureBufferSize(int)
Encoder
,
EncoderFactory
,
BlockingBinaryEncoder
,
DirectBinaryEncoder
Method Summary | |
---|---|
int |
bytesBuffered()
Returns the number of bytes currently buffered by this encoder. |
void |
flush()
|
void |
writeBoolean(boolean b)
Write a boolean value. |
void |
writeDouble(double d)
Write a double. |
void |
writeFixed(byte[] bytes,
int start,
int len)
Writes a fixed size binary object. |
void |
writeFloat(float f)
Write a float. |
void |
writeInt(int n)
Writes a 32-bit integer. |
void |
writeLong(long n)
Write a 64-bit integer. |
protected void |
writeZero()
Write a zero byte to the underlying output. |
Methods inherited from class org.apache.avro.io.BinaryEncoder |
---|
setItemCount, startItem, writeArrayEnd, writeArrayStart, writeBytes, writeBytes, writeEnum, writeIndex, writeMapEnd, writeMapStart, writeNull, writeString, writeString |
Methods inherited from class org.apache.avro.io.Encoder |
---|
writeBytes, writeFixed, writeString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void flush() throws IOException
IOException
public void writeBoolean(boolean b) throws IOException
Encoder
writeBoolean
in class Encoder
IOException
public void writeInt(int n) throws IOException
Encoder
writeInt
in class Encoder
IOException
public void writeLong(long n) throws IOException
Encoder
writeLong
in class Encoder
IOException
public void writeFloat(float f) throws IOException
Encoder
writeFloat
in class Encoder
IOException
public void writeDouble(double d) throws IOException
Encoder
writeDouble
in class Encoder
IOException
public void writeFixed(byte[] bytes, int start, int len) throws IOException
Encoder
writeFixed
in class Encoder
bytes
- The contents to writestart
- The position within bytes where the contents
start.len
- The number of bytes to write.
IOException
protected void writeZero() throws IOException
BinaryEncoder
writeZero
in class BinaryEncoder
IOException
public int bytesBuffered()
BinaryEncoder
Flushable.flush()
to empty the buffer to the underlying output.
bytesBuffered
in class BinaryEncoder
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |