public abstract class SliceInput extends InputStream implements DataInput
| Constructor and Description |
|---|
SliceInput() |
| Modifier and Type | Method and Description |
|---|---|
abstract int |
available()
Returns the number of bytes that can be read without blocking.
|
void |
close() |
abstract boolean |
isReadable()
Returns
true
if and only if available() is greater
than 0. |
void |
mark(int readLimit) |
boolean |
markSupported() |
abstract long |
position()
Returns the
position of this buffer. |
abstract int |
read() |
int |
read(byte[] destination) |
abstract int |
read(byte[] destination,
int destinationIndex,
int length) |
abstract boolean |
readBoolean()
Returns true if the byte at the current
position is not 0 and increases
the position by 1 in this buffer. |
abstract byte |
readByte()
Gets a byte at the current
position and increases
the position by 1 in this buffer. |
void |
readBytes(byte[] destination)
Transfers this buffer's data to the specified destination starting at
the current
position and increases the position
by the number of the transferred bytes (= dst.length). |
abstract void |
readBytes(byte[] destination,
int destinationIndex,
int length)
Transfers this buffer's data to the specified destination starting at
the current
position and increases the position
by the number of the transferred bytes (= length). |
abstract void |
readBytes(OutputStream out,
int length)
Transfers this buffer's data to the specified stream starting at the
current
position. |
void |
readBytes(Slice destination)
Transfers this buffer's data to the specified destination starting at
the current
position until the destination becomes
non-writable, and increases the position by the number of the
transferred bytes. |
void |
readBytes(Slice destination,
int length)
Transfers this buffer's data to the specified destination starting at
the current
position and increases the position
by the number of the transferred bytes (= length). |
abstract void |
readBytes(Slice destination,
int destinationIndex,
int length)
Transfers this buffer's data to the specified destination starting at
the current
position and increases the position
by the number of the transferred bytes (= length). |
char |
readChar() |
abstract double |
readDouble()
Gets a 64-bit double at the current
position
and increases the position by 8 in this buffer. |
abstract float |
readFloat()
Gets a 32-bit float at the current
position
and increases the position by 4 in this buffer. |
void |
readFully(byte[] destination) |
void |
readFully(byte[] destination,
int offset,
int length) |
abstract int |
readInt()
Gets a 32-bit integer at the current
position
and increases the position by 4 in this buffer. |
String |
readLine() |
abstract long |
readLong()
Gets a 64-bit long at the current
position
and increases the position by 8 in this buffer. |
abstract short |
readShort()
Gets a 16-bit short integer at the current
position
and increases the position by 2 in this buffer. |
abstract Slice |
readSlice(int length)
Returns a new slice of this buffer's sub-region starting at the current
position and increases the position by the size
of the new slice (= length). |
abstract int |
readUnsignedByte()
Gets an unsigned byte at the current
position and increases
the position by 1 in this buffer. |
long |
readUnsignedInt()
Gets an unsigned 32-bit integer at the current
position
and increases the position by 4 in this buffer. |
abstract int |
readUnsignedShort()
Gets an unsigned 16-bit short integer at the current
position
and increases the position by 2 in this buffer. |
String |
readUTF() |
void |
reset() |
abstract void |
setPosition(long position)
Sets the
position of this buffer. |
abstract long |
skip(long length) |
abstract int |
skipBytes(int length) |
public abstract long position()
position of this buffer.public abstract void setPosition(long position)
position of this buffer.IndexOutOfBoundsException - if the specified position is
less than 0 or
greater than this.writerIndexpublic abstract boolean isReadable()
true
if and only if available() is greater
than 0.public abstract int available()
available in class InputStreampublic abstract int read()
read in class InputStreampublic abstract boolean readBoolean()
position is not 0 and increases
the position by 1 in this buffer.readBoolean in interface DataInputIndexOutOfBoundsException - if this.available() is less than 1public abstract byte readByte()
position and increases
the position by 1 in this buffer.readByte in interface DataInputIndexOutOfBoundsException - if this.available() is less than 1public abstract int readUnsignedByte()
position and increases
the position by 1 in this buffer.readUnsignedByte in interface DataInputIndexOutOfBoundsException - if this.available() is less than 1public abstract short readShort()
position
and increases the position by 2 in this buffer.readShort in interface DataInputIndexOutOfBoundsException - if this.available() is less than 2public abstract int readUnsignedShort()
position
and increases the position by 2 in this buffer.readUnsignedShort in interface DataInputIndexOutOfBoundsException - if this.available() is less than 2public abstract int readInt()
position
and increases the position by 4 in this buffer.readInt in interface DataInputIndexOutOfBoundsException - if this.available() is less than 4public final long readUnsignedInt()
position
and increases the position by 4 in this buffer.IndexOutOfBoundsException - if this.available() is less than 4public abstract long readLong()
position
and increases the position by 8 in this buffer.readLong in interface DataInputIndexOutOfBoundsException - if this.available() is less than 8public abstract float readFloat()
position
and increases the position by 4 in this buffer.readFloat in interface DataInputIndexOutOfBoundsException - if this.available() is less than 4public abstract double readDouble()
position
and increases the position by 8 in this buffer.readDouble in interface DataInputIndexOutOfBoundsException - if this.available() is less than 8public abstract Slice readSlice(int length)
position and increases the position by the size
of the new slice (= length).length - the size of the new sliceIndexOutOfBoundsException - if length is greater than this.available()public final void readFully(byte[] destination)
public final int read(byte[] destination)
read in class InputStreampublic abstract int read(byte[] destination,
int destinationIndex,
int length)
read in class InputStreampublic final void readBytes(byte[] destination)
position and increases the position
by the number of the transferred bytes (= dst.length).IndexOutOfBoundsException - if dst.length is greater than this.available()public final void readFully(byte[] destination,
int offset,
int length)
public abstract void readBytes(byte[] destination,
int destinationIndex,
int length)
position and increases the position
by the number of the transferred bytes (= length).destinationIndex - the first index of the destinationlength - the number of bytes to transferIndexOutOfBoundsException - if the specified destinationIndex is less than 0,
if length is greater than this.available(), or
if destinationIndex + length is greater than destination.lengthpublic final void readBytes(Slice destination)
position until the destination becomes
non-writable, and increases the position by the number of the
transferred bytes. This method is basically same with
readBytes(Slice, int, int), except that this method
increases the writerIndex of the destination by the number of
the transferred bytes while readBytes(Slice, int, int)
does not.IndexOutOfBoundsException - if destination.writableBytes is greater than
this.available()public final void readBytes(Slice destination, int length)
position and increases the position
by the number of the transferred bytes (= length). This method
is basically same with readBytes(Slice, int, int),
except that this method increases the writerIndex of the
destination by the number of the transferred bytes (= length)
while readBytes(Slice, int, int) does not.IndexOutOfBoundsException - if length is greater than this.available() or
if length is greater than destination.writableBytespublic abstract void readBytes(Slice destination, int destinationIndex, int length)
position and increases the position
by the number of the transferred bytes (= length).destinationIndex - the first index of the destinationlength - the number of bytes to transferIndexOutOfBoundsException - if the specified destinationIndex is less than 0,
if length is greater than this.available(), or
if destinationIndex + length is greater than
destination.capacitypublic abstract void readBytes(OutputStream out, int length) throws IOException
position.length - the number of bytes to transferIndexOutOfBoundsException - if length is greater than this.available()IOException - if the specified stream threw an exception during I/Opublic abstract long skip(long length)
skip in class InputStreampublic void close()
close in interface Closeableclose in interface AutoCloseableclose in class InputStreampublic final void mark(int readLimit)
mark in class InputStreampublic final void reset()
reset in class InputStreampublic final boolean markSupported()
markSupported in class InputStreamCopyright © 2012-2015. All Rights Reserved.