public interface BufferOutput<T extends BufferOutput<?>> extends AutoCloseable
This interface exposes methods for writing to a byte buffer. Writable buffers maintain a small amount of state
regarding current cursor positions and limits similar to the behavior of ByteBuffer.
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
T |
flush()
Flushes the buffer to the underlying persistence layer.
|
T |
write(Buffer buffer)
Writes a buffer to the buffer.
|
T |
write(byte[] bytes)
Writes an array of bytes to the buffer.
|
T |
write(byte[] bytes,
int offset,
int length)
Writes an array of bytes to the buffer.
|
T |
write(Bytes bytes)
Writes an array of bytes to the buffer.
|
T |
write(Bytes bytes,
int offset,
int length)
Writes an array of bytes to the buffer.
|
T |
writeBoolean(boolean b)
Writes a 1 byte boolean to the buffer.
|
T |
writeByte(int b)
Writes a byte to the buffer.
|
default T |
writeBytes(byte[] bytes)
Writes a byte array.
|
T |
writeChar(char c)
Writes a 16-bit character to the buffer.
|
T |
writeDouble(double d)
Writes a double-precision 64-bit floating point number to the buffer.
|
T |
writeFloat(float f)
Writes a single-precision 32-bit floating point number to the buffer.
|
T |
writeInt(int i)
Writes a 32-bit signed integer to the buffer.
|
T |
writeLong(long l)
Writes a 64-bit signed integer to the buffer.
|
T |
writeMedium(int m)
Writes a 24-bit signed integer to the buffer.
|
T |
writeShort(short s)
Writes a 16-bit signed integer to the buffer.
|
T |
writeString(String s)
Writes a string to the buffer.
|
T |
writeString(String s,
Charset charset)
Writes a string to the buffer.
|
T |
writeUnsignedByte(int b)
Writes an unsigned byte to the buffer.
|
T |
writeUnsignedInt(long i)
Writes a 32-bit unsigned integer to the buffer.
|
T |
writeUnsignedMedium(int m)
Writes a 24-bit unsigned integer to the buffer.
|
T |
writeUnsignedShort(int s)
Writes a 16-bit unsigned integer to the buffer.
|
T |
writeUTF8(String s)
Writes a UTF-8 string to the buffer.
|
T write(Bytes bytes)
bytes - The array of bytes to write.T write(byte[] bytes)
bytes - The array of bytes to write.T write(Bytes bytes, int offset, int length)
bytes - The array of bytes to write.offset - The offset at which to start writing the bytes.length - The number of bytes from the provided byte array to write to the buffer.T write(byte[] bytes, int offset, int length)
bytes - The array of bytes to write.offset - The offset at which to start writing the bytes.length - The number of bytes from the provided byte array to write to the buffer.T write(Buffer buffer)
buffer - The buffer to write.default T writeBytes(byte[] bytes)
bytes - The byte array to write.T writeByte(int b)
b - The byte to write.T writeUnsignedByte(int b)
b - The byte to write.T writeChar(char c)
c - The character to write.T writeShort(short s)
s - The short to write.T writeUnsignedShort(int s)
s - The short to write.T writeMedium(int m)
m - The integer to write.T writeUnsignedMedium(int m)
m - The integer to write.T writeInt(int i)
i - The integer to write.T writeUnsignedInt(long i)
i - The integer to write.T writeLong(long l)
l - The long to write.T writeFloat(float f)
f - The float to write.T writeDouble(double d)
d - The double to write.T writeBoolean(boolean b)
b - The boolean to write.T writeString(String s)
s - The string to write.T writeString(String s, Charset charset)
s - The string to write.charset - The character set with which to encode the string.T writeUTF8(String s)
s - The string to write.T flush()
void close()
close in interface AutoCloseableCopyright © 2013–2017. All rights reserved.