public class ChannelBufferInputStream extends InputStream implements DataInput
InputStream
which reads data from a ChannelBuffer
.
A read operation against this stream will occur at the readerIndex
of its underlying buffer and the readerIndex
will increase during
the read operation.
This stream implements DataInput
for your convenience.
The endianness of the stream is not always big endian but depends on
the endianness of the underlying buffer.
ChannelBufferOutputStream
Constructor and Description |
---|
ChannelBufferInputStream(ChannelBuffer buffer)
Creates a new stream which reads data from the specified
buffer
starting at the current readerIndex and ending at the current
writerIndex . |
ChannelBufferInputStream(ChannelBuffer buffer,
int length)
Creates a new stream which reads data from the specified
buffer
starting at the current readerIndex and ending at
readerIndex + length . |
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
boolean |
readBoolean() |
byte |
readByte() |
int |
readBytes()
Returns the number of read bytes by this stream so far.
|
char |
readChar() |
double |
readDouble() |
float |
readFloat() |
void |
readFully(byte[] b) |
void |
readFully(byte[] b,
int off,
int len) |
int |
readInt() |
String |
readLine() |
long |
readLong() |
short |
readShort() |
int |
readUnsignedByte() |
int |
readUnsignedShort() |
String |
readUTF() |
void |
reset() |
long |
skip(long n) |
int |
skipBytes(int n) |
close, read
public ChannelBufferInputStream(ChannelBuffer buffer)
buffer
starting at the current readerIndex
and ending at the current
writerIndex
.public ChannelBufferInputStream(ChannelBuffer buffer, int length)
buffer
starting at the current readerIndex
and ending at
readerIndex + length
.IndexOutOfBoundsException
- if readerIndex + length
is greater than
writerIndex
public int readBytes()
public int available() throws IOException
available
in class InputStream
IOException
public void mark(int readlimit)
mark
in class InputStream
public boolean markSupported()
markSupported
in class InputStream
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public void reset() throws IOException
reset
in class InputStream
IOException
public long skip(long n) throws IOException
skip
in class InputStream
IOException
public boolean readBoolean() throws IOException
readBoolean
in interface DataInput
IOException
public byte readByte() throws IOException
readByte
in interface DataInput
IOException
public char readChar() throws IOException
readChar
in interface DataInput
IOException
public double readDouble() throws IOException
readDouble
in interface DataInput
IOException
public float readFloat() throws IOException
readFloat
in interface DataInput
IOException
public void readFully(byte[] b) throws IOException
readFully
in interface DataInput
IOException
public void readFully(byte[] b, int off, int len) throws IOException
readFully
in interface DataInput
IOException
public int readInt() throws IOException
readInt
in interface DataInput
IOException
public String readLine() throws IOException
readLine
in interface DataInput
IOException
public long readLong() throws IOException
readLong
in interface DataInput
IOException
public short readShort() throws IOException
readShort
in interface DataInput
IOException
public String readUTF() throws IOException
readUTF
in interface DataInput
IOException
public int readUnsignedByte() throws IOException
readUnsignedByte
in interface DataInput
IOException
public int readUnsignedShort() throws IOException
readUnsignedShort
in interface DataInput
IOException
public int skipBytes(int n) throws IOException
skipBytes
in interface DataInput
IOException
Copyright © 2008-2014 The Netty Project. All Rights Reserved.