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)
os
static DurableOutput from(WritableByteChannel channel)
channel
default void write(byte[] b)
write
in interface DataOutput
default void write(byte[] b, int off, int len)
write
in interface DataOutput
void close()
close
in interface AutoCloseable
close
in interface Closeable
void writeByte(int v)
int8
to the output.writeByte
in interface DataOutput
default void writeUnsignedByte(int v)
uint8
to the output.void writeShort(int v)
int16
to the output.writeShort
in interface DataOutput
default void writeUnsignedShort(int v)
uint16
to the output.void writeChar(int v)
int16
to the output.writeChar
in interface DataOutput
void writeInt(int v)
int32
to the output.writeInt
in interface DataOutput
default void writeUnsignedInt(long v)
uint32
to the output.void writeLong(long v)
int64
to the output.writeLong
in interface DataOutput
void writeFloat(float v)
float32
to the output.writeFloat
in interface DataOutput
void writeDouble(double v)
float64
to the output.writeDouble
in interface DataOutput
void 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 DataOutput
default void writeBytes(String s)
writeBytes
in interface DataOutput
default void writeChars(String s)
writeChars
in interface DataOutput
default void writeUTF(String s)
writeUTF
in interface DataOutput
default void writeBoolean(boolean v)
writeBoolean
in interface DataOutput
void 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