public class SimpleDataInput extends ByteInputStream implements DataInput
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
buffer |
protected int |
limit |
protected int |
position |
byteInput| Constructor and Description |
|---|
SimpleDataInput(ByteInput byteInput) |
SimpleDataInput(int bufferSize) |
SimpleDataInput(int bufferSize,
ByteInput byteInput) |
| Modifier and Type | Method and Description |
|---|---|
int |
available()
Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without
blocking by the next invocation of a method for this input stream.
|
void |
close() |
protected void |
finish() |
int |
read()
Reads the next byte of data from the input stream.
|
int |
read(byte[] b)
Read some bytes from the input stream into the given array.
|
int |
read(byte[] b,
int off,
int len)
Read some bytes from the input stream into the given array.
|
boolean |
readBoolean() |
byte |
readByte() |
char |
readChar() |
double |
readDouble() |
float |
readFloat() |
void |
readFully(byte[] b) |
void |
readFully(byte[] b,
int off,
int len) |
int |
readInt() |
protected int |
readIntDirect() |
String |
readLine() |
long |
readLong() |
protected long |
readLongDirect() |
short |
readShort() |
int |
readUnsignedByte() |
protected int |
readUnsignedByteDirect() |
int |
readUnsignedShort() |
String |
readUTF() |
long |
skip(long n)
Skips over and discards up to
n bytes of data from this input stream. |
int |
skipBytes(int n) |
protected void |
start(ByteInput byteInput) |
mark, markSupported, resetprotected final byte[] buffer
protected int position
protected int limit
public SimpleDataInput(int bufferSize)
public SimpleDataInput(int bufferSize,
ByteInput byteInput)
public SimpleDataInput(ByteInput byteInput)
public int read()
throws IOException
read in interface ByteInputread in class ByteInputStreamIOException - if an error occurspublic int read(byte[] b)
throws IOException
read in interface ByteInputread in class ByteInputStreamb - the destination arrayIOException - if an error occurspublic int read(byte[] b,
int off,
int len)
throws IOException
read in interface ByteInputread in class ByteInputStreamb - the destination arrayoff - the offset into the array into which data should be readlen - the number of bytes to attempt to fill in the destination arrayIOException - if an error occurspublic long skip(long n)
throws IOException
n bytes of data from this input stream. If the end of stream is reached,
this method returns 0 in order to be consistent with InputStream.skip(long).skip in interface ByteInputskip in class ByteInputStreamn - the number of bytes to attempt to skipIOException - if an error occurspublic int available()
throws IOException
available in interface ByteInputavailable in class ByteInputStreamIOException - if an error occurspublic void readFully(byte[] b)
throws IOException
readFully in interface DataInputIOExceptionpublic void readFully(byte[] b,
int off,
int len)
throws IOException
readFully in interface DataInputIOExceptionpublic int skipBytes(int n)
throws IOException
skipBytes in interface DataInputIOExceptionpublic boolean readBoolean()
throws IOException
readBoolean in interface DataInputIOExceptionpublic byte readByte()
throws IOException
readByte in interface DataInputIOExceptionpublic int readUnsignedByte()
throws IOException
readUnsignedByte in interface DataInputIOExceptionpublic short readShort()
throws IOException
readShort in interface DataInputIOExceptionpublic int readUnsignedShort()
throws IOException
readUnsignedShort in interface DataInputIOExceptionprotected int readUnsignedByteDirect()
throws IOException
IOExceptionpublic char readChar()
throws IOException
readChar in interface DataInputIOExceptionpublic int readInt()
throws IOException
readInt in interface DataInputIOExceptionpublic long readLong()
throws IOException
readLong in interface DataInputIOExceptionprotected long readLongDirect()
throws IOException
IOExceptionpublic float readFloat()
throws IOException
readFloat in interface DataInputIOExceptionprotected int readIntDirect()
throws IOException
IOExceptionpublic double readDouble()
throws IOException
readDouble in interface DataInputIOExceptionpublic String readLine() throws IOException
readLine in interface DataInputIOExceptionpublic String readUTF() throws IOException
readUTF in interface DataInputIOExceptionpublic void close()
throws IOException
ByteInputStreamclose in interface Closeableclose in interface AutoCloseableclose in class ByteInputStreamIOExceptionprotected void start(ByteInput byteInput) throws IOException
IOExceptionprotected void finish()
throws IOException
IOExceptionCopyright © 2012 JBoss by Red Hat. All Rights Reserved.