public class ChannelBufferUnsafeDataInputStream extends ChannelBufferUnsafeInputStream implements DataInput
UnsafeHolder.getDirectByteBufferAddressMethod() to be non-null before
trying to use this class.
The implementation is not thread-safe by design. This particular class can be used as an efficient, buffered DataInput implementation for file channels, socket channels and other similar.
addrLimit, addrPosition, baseAddress, buffer, unsafechannel, PARK_NANOS, PARK_NANOS_MAX, parkedThread| Constructor and Description |
|---|
ChannelBufferUnsafeDataInputStream(ReadableByteChannel channel) |
ChannelBufferUnsafeDataInputStream(ReadableByteChannel channel,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
protected short |
getShort(long addrPos) |
boolean |
readBoolean() |
byte |
readByte() |
char |
readChar() |
double |
readDouble() |
float |
readFloat() |
void |
readFully(byte[] b) |
void |
readFully(byte[] b,
int off,
int len) |
String |
readLine() |
long |
readLong() |
short |
readShort() |
int |
readUnsignedByte() |
int |
readUnsignedShort() |
String |
readUTF() |
int |
skipBytes(int n)
Currently not supported by this implementation.
|
allocateBuffer, available, close, getInt, isOpen, read, read, read, read, readInt, refillBuffer, resetBufferPositionsgetParkedThread, getUnderlyingChannel, readBuffered, readFrame, readFrameFragment, readIntoBuffer, readIntoBufferNonBlocking, resetAndCopyLeftOverBytesmark, markSupported, reset, skippublic ChannelBufferUnsafeDataInputStream(ReadableByteChannel channel) throws IOException
IOExceptionpublic ChannelBufferUnsafeDataInputStream(ReadableByteChannel channel, int bufferSize) throws IOException
IOExceptionpublic final void readFully(byte[] b)
throws IOException
readFully in interface DataInputIOExceptionpublic final void readFully(byte[] b,
int off,
int len)
throws IOException
readFully in interface DataInputIOExceptionpublic int skipBytes(int n)
throws IOException
skipBytes in interface DataInputIOExceptionpublic final boolean readBoolean()
throws IOException
readBoolean in interface DataInputIOExceptionpublic final byte readByte()
throws IOException
readByte in interface DataInputIOExceptionpublic final int readUnsignedByte()
throws IOException
readUnsignedByte in interface DataInputIOExceptionpublic final short readShort()
throws IOException
readShort in interface DataInputIOExceptionpublic final int readUnsignedShort()
throws IOException
readUnsignedShort in interface DataInputIOExceptionpublic final char readChar()
throws IOException
readChar in interface DataInputIOExceptionpublic final long readLong()
throws IOException
readLong in interface DataInputIOExceptionpublic final float readFloat()
throws IOException
readFloat in interface DataInputIOExceptionpublic final double readDouble()
throws IOException
readDouble in interface DataInputIOExceptionpublic String readUTF() throws IOException
readUTF in interface DataInputIOExceptionprotected final short getShort(long addrPos)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.