public class BufferedChannelInput extends java.lang.Object implements DurableInput
DurableInput atop BufferedChannel.DurableInput.Bounds, DurableInput.Pool| Constructor and Description |
|---|
BufferedChannelInput(BufferedChannel channel) |
BufferedChannelInput(BufferedChannel channel,
long start,
long end,
java.lang.Runnable closeFn) |
| Modifier and Type | Method and Description |
|---|---|
DurableInput.Bounds |
bounds() |
void |
close()
Closes the input, freeing any resources associated with it.
|
DurableInput |
duplicate() |
DurableInput.Pool |
pool() |
long |
position() |
int |
read(java.nio.ByteBuffer dst)
Copies as many byte as possible into
dst, and returns the number of bytes. |
byte |
readByte()
Reads and advances past the next
int8 value. |
char |
readChar()
Reads and advances past the next
int16 value. |
double |
readDouble()
Reads and advances past the next
float64 value. |
float |
readFloat()
Reads and advances past the next
float32 value. |
void |
readFully(byte[] b,
int off,
int len)
Copies bytes into
b, starting at offset, throwing an EOFException if there are not len
bytes available. |
int |
readInt()
Reads and advances past the next
int32 value. |
long |
readLong()
Reads and advances past the next
int64 value. |
short |
readShort()
Reads and advances past the next
int16 value. |
long |
remaining() |
BufferedChannelInput |
seek(long position)
Updates the position of the input, and returns itself.
|
long |
size() |
int |
skipBytes(int n)
Advances the position by
n bytes. |
DurableInput |
slice(long start,
long end) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasInputStream, from, hasRemaining, hexBytes, peekPrefix, readBoolean, readFully, readLine, readPrefix, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, readUVLQ, readVLQ, skipBlock, skipBytes, sliceBlock, sliceBytes, slicePrefixedBlockpublic BufferedChannelInput(BufferedChannel channel)
public BufferedChannelInput(BufferedChannel channel, long start, long end, java.lang.Runnable closeFn)
public DurableInput.Pool pool()
pool in interface DurableInputpublic DurableInput slice(long start, long end)
slice in interface DurableInput[start, end)public void close()
DurableInputclose in interface DurableInputclose in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic DurableInput.Bounds bounds()
bounds in interface DurableInputpublic DurableInput duplicate()
duplicate in interface DurableInputpublic BufferedChannelInput seek(long position)
DurableInputseek in interface DurableInputpublic long size()
size in interface DurableInputpublic long position()
position in interface DurableInputpublic void readFully(byte[] b,
int off,
int len)
throws java.io.EOFException
DurableInputb, starting at offset, throwing an EOFException if there are not len
bytes available.readFully in interface DurableInputreadFully in interface java.io.DataInputjava.io.EOFExceptionpublic int read(java.nio.ByteBuffer dst)
DurableInputdst, and returns the number of bytes.read in interface DurableInputpublic long remaining()
remaining in interface DurableInputpublic int skipBytes(int n)
DurableInputn bytes.skipBytes in interface DurableInputskipBytes in interface java.io.DataInputpublic byte readByte()
DurableInputint8 value.readByte in interface DurableInputreadByte in interface java.io.DataInputpublic short readShort()
DurableInputint16 value.readShort in interface DurableInputreadShort in interface java.io.DataInputpublic char readChar()
DurableInputint16 value.readChar in interface DurableInputreadChar in interface java.io.DataInputpublic int readInt()
DurableInputint32 value.readInt in interface DurableInputreadInt in interface java.io.DataInputpublic long readLong()
DurableInputint64 value.readLong in interface DurableInputreadLong in interface java.io.DataInputpublic float readFloat()
DurableInputfloat32 value.readFloat in interface DurableInputreadFloat in interface java.io.DataInputpublic double readDouble()
DurableInputfloat64 value.readDouble in interface DurableInputreadDouble in interface java.io.DataInput