|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectco.cask.tigon.io.BufferedEncoder
public final class BufferedEncoder
A Encoder that performs all writes to in memory buffer.
| Constructor Summary | |
|---|---|
BufferedEncoder(int size,
com.google.common.base.Function<OutputStream,Encoder> encoderFactory)
|
|
| Method Summary | |
|---|---|
void |
reset()
|
int |
size()
|
Encoder |
writeBool(boolean b)
|
Encoder |
writeBytes(byte[] bytes)
|
Encoder |
writeBytes(byte[] bytes,
int off,
int len)
|
Encoder |
writeBytes(ByteBuffer bytes)
Writes out the remaining bytes in ByteBuffer. |
Encoder |
writeDouble(double d)
|
Encoder |
writeFloat(float f)
|
Encoder |
writeInt(int i)
|
Encoder |
writeLong(long l)
|
Encoder |
writeNull()
|
Encoder |
writeRaw(byte[] rawBytes)
Writes raw bytes to the buffer without encoding. |
Encoder |
writeRaw(byte[] rawBytes,
int off,
int len)
Writes raw bytes to the buffer without encoding. |
Encoder |
writeString(String s)
|
void |
writeTo(OutputStream out)
Writes all the buffered bytes into the given OutputStream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BufferedEncoder(int size,
com.google.common.base.Function<OutputStream,Encoder> encoderFactory)
| Method Detail |
|---|
public void reset()
public void writeTo(OutputStream out)
throws IOException
out - The output stream to write to.
IOExceptionpublic int size()
public Encoder writeRaw(byte[] rawBytes)
throws IOException
writeRaw(rawBytes, 0, rawBytes.length).
IOException
public Encoder writeRaw(byte[] rawBytes,
int off,
int len)
throws IOException
rawBytes - The bytes to write.off - Offset to start in the byte array.len - Number of bytes to write starting from the offset.
IOException
public Encoder writeNull()
throws IOException
writeNull in interface EncoderIOException
public Encoder writeBool(boolean b)
throws IOException
writeBool in interface EncoderIOException
public Encoder writeInt(int i)
throws IOException
writeInt in interface EncoderIOException
public Encoder writeLong(long l)
throws IOException
writeLong in interface EncoderIOException
public Encoder writeFloat(float f)
throws IOException
writeFloat in interface EncoderIOException
public Encoder writeDouble(double d)
throws IOException
writeDouble in interface EncoderIOException
public Encoder writeString(String s)
throws IOException
writeString in interface EncoderIOException
public Encoder writeBytes(byte[] bytes)
throws IOException
writeBytes in interface EncoderIOException
public Encoder writeBytes(byte[] bytes,
int off,
int len)
throws IOException
writeBytes in interface EncoderIOException
public Encoder writeBytes(ByteBuffer bytes)
throws IOException
EncoderByteBuffer.
The given ByteBuffer is untouched after this method returns (i.e. same position and limit).
writeBytes in interface EncoderIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||