public class ByteChannelOutput extends java.lang.Object implements DurableOutput
DurableOutput atop WritableByteChannel.| Constructor and Description |
|---|
ByteChannelOutput(java.nio.channels.WritableByteChannel channel) |
ByteChannelOutput(java.nio.channels.WritableByteChannel channel,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
append(java.lang.Iterable<IBuffer> buffers)
Appends
buffers to the output. |
void |
close() |
void |
flush()
Flushes any buffered data to the underlying sink.
|
void |
transferFrom(DurableInput in)
Copies all bytes from
in to the output. |
static void |
wrap(java.nio.channels.WritableByteChannel channel,
java.util.function.Consumer<ByteChannelOutput> body) |
int |
write(java.nio.ByteBuffer src)
Copies all bytes from
src to the output, returning the number of bytes copied. |
void |
writeByte(int v)
Writes an
int8 to the output. |
void |
writeChar(int v)
Writes an
int16 to the output. |
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. |
long |
written() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasOutputStream, from, from, write, write, write, writeBoolean, writeBytes, writeChars, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUTF, writeUVLQ, writeVLQpublic ByteChannelOutput(java.nio.channels.WritableByteChannel channel)
public ByteChannelOutput(java.nio.channels.WritableByteChannel channel,
int bufferSize)
public static void wrap(java.nio.channels.WritableByteChannel channel,
java.util.function.Consumer<ByteChannelOutput> body)
public void transferFrom(DurableInput in)
DurableOutputin to the output.transferFrom in interface DurableOutputpublic void append(java.lang.Iterable<IBuffer> buffers)
DurableOutputbuffers to the output.
Intended for internal use, may be subject to change.append in interface DurableOutputpublic long written()
written in interface DurableOutputpublic void flush()
DurableOutputflush in interface DurableOutputflush in interface java.io.Flushablepublic void close()
close in interface DurableOutputclose in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic int write(java.nio.ByteBuffer src)
DurableOutputsrc to the output, returning the number of bytes copied.write in interface DurableOutputpublic void writeByte(int v)
DurableOutputint8 to the output.writeByte in interface DurableOutputwriteByte in interface java.io.DataOutputpublic void writeShort(int v)
DurableOutputint16 to the output.writeShort in interface DurableOutputwriteShort in interface java.io.DataOutputpublic void writeChar(int v)
DurableOutputint16 to the output.writeChar in interface DurableOutputwriteChar in interface java.io.DataOutputpublic void writeInt(int v)
DurableOutputint32 to the output.writeInt in interface DurableOutputwriteInt in interface java.io.DataOutputpublic void writeLong(long v)
DurableOutputint64 to the output.writeLong in interface DurableOutputwriteLong in interface java.io.DataOutputpublic void writeFloat(float v)
DurableOutputfloat32 to the output.writeFloat in interface DurableOutputwriteFloat in interface java.io.DataOutputpublic void writeDouble(double v)
DurableOutputfloat64 to the output.writeDouble in interface DurableOutputwriteDouble in interface java.io.DataOutput