public interface DurableOutput extends DataOutput, Flushable, Closeable, AutoCloseable
DataOutput with some additional utility functions.| Modifier and Type | Method and Description |
|---|---|
void |
append(Iterable<io.lacuna.bifurcan.durable.allocator.IBuffer> buffers)
Appends
buffers to the output. |
default OutputStream |
asOutputStream() |
void |
close() |
void |
flush()
Flushes any buffered data to the underlying sink.
|
static DurableOutput |
from(OutputStream os) |
static DurableOutput |
from(WritableByteChannel channel) |
void |
transferFrom(DurableInput in)
Copies all bytes from
in to the output. |
default void |
write(byte[] b) |
default void |
write(byte[] b,
int off,
int len) |
int |
write(ByteBuffer src)
Copies all bytes from
src to the output, returning the number of bytes copied. |
default void |
write(int b) |
default void |
writeBoolean(boolean v) |
void |
writeByte(int v)
Writes an
int8 to the output. |
default void |
writeBytes(String s) |
void |
writeChar(int v)
Writes an
int16 to the output. |
default void |
writeChars(String s) |
void |
writeDouble(double v)
Writes a
float64 to the output. |
void |
writeFloat(float v)
Writes a
float32 to the output. |
void |
writeInt(int v)
Writes an
int32 to the output. |
void |
writeLong(long v)
Writes an
int64 to the output. |
void |
writeShort(int v)
Writes an
int16 to the output. |
default void |
writeUnsignedByte(int v)
Writes an
uint8 to the output. |
default void |
writeUnsignedInt(long v)
Writes an
uint32 to the output. |
default void |
writeUnsignedShort(int v)
Writes an
uint16 to the output. |
default void |
writeUTF(String s) |
default void |
writeUVLQ(long n) |
default void |
writeVLQ(long n) |
long |
written() |
static DurableOutput from(OutputStream os)
osstatic DurableOutput from(WritableByteChannel channel)
channeldefault void write(byte[] b)
write in interface DataOutputdefault void write(byte[] b,
int off,
int len)
write in interface DataOutputvoid close()
close in interface AutoCloseableclose in interface Closeablevoid writeByte(int v)
int8 to the output.writeByte in interface DataOutputdefault void writeUnsignedByte(int v)
uint8 to the output.void writeShort(int v)
int16 to the output.writeShort in interface DataOutputdefault void writeUnsignedShort(int v)
uint16 to the output.void writeChar(int v)
int16 to the output.writeChar in interface DataOutputvoid writeInt(int v)
int32 to the output.writeInt in interface DataOutputdefault void writeUnsignedInt(long v)
uint32 to the output.void writeLong(long v)
int64 to the output.writeLong in interface DataOutputvoid writeFloat(float v)
float32 to the output.writeFloat in interface DataOutputvoid writeDouble(double v)
float64 to the output.writeDouble in interface DataOutputvoid flush()
long written()
int write(ByteBuffer src)
src to the output, returning the number of bytes copied.default void writeVLQ(long n)
default void writeUVLQ(long n)
default void write(int b)
write in interface DataOutputdefault void writeBytes(String s)
writeBytes in interface DataOutputdefault void writeChars(String s)
writeChars in interface DataOutputdefault void writeUTF(String s)
writeUTF in interface DataOutputdefault void writeBoolean(boolean v)
writeBoolean in interface DataOutputvoid transferFrom(DurableInput in)
in to the output.void append(Iterable<io.lacuna.bifurcan.durable.allocator.IBuffer> buffers)
buffers to the output.
Intended for internal use, may be subject to change.default OutputStream asOutputStream()
OutputStream corresponding to this output