public class FastByteArrayInputStream extends ByteArrayInputStream implements DataInput
buf, count, mark, pos| Constructor and Description |
|---|
FastByteArrayInputStream(byte[] buf) |
FastByteArrayInputStream(byte[] buf,
int offset,
int length) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
boolean |
readBoolean() |
byte |
readByte()
See the general contract of the
readByte method of
DataInput. |
char |
readChar()
See the general contract of the
readChar method of
DataInput. |
double |
readDouble()
See the general contract of the
readDouble method of
DataInput. |
float |
readFloat()
See the general contract of the
readFloat method of
DataInput. |
void |
readFully(byte[] b) |
void |
readFully(byte[] b,
int off,
int len) |
int |
readInt()
See the general contract of the
readInt method of
DataInput. |
String |
readLine()
Deprecated.
This method does not properly convert bytes to characters. As
of JDK 1.1, the preferred way to read lines of text is
via the
BufferedReader.readLine() method.
Programs that use the DataInputStream class to
read lines can be converted to use the
BufferedReader class by replacing code of the
form:
with:
|
long |
readLong()
See the general contract of the
readLong method of
DataInput. |
short |
readShort()
See the general contract of the
readShort method of
DataInput. |
int |
readUnsignedByte()
See the general contract of the
readUnsignedByte method of
DataInput. |
int |
readUnsignedShort()
See the general contract of the
readUnsignedShort method of
DataInput. |
String |
readUTF()
See the general contract of the
readUTF method of
DataInput. |
void |
reset() |
void |
set(byte[] bytes,
int size) |
long |
skip(long n) |
int |
skipBytes(int n) |
close, markreadpublic FastByteArrayInputStream(byte[] buf)
public FastByteArrayInputStream(byte[] buf,
int offset,
int length)
public int read()
read in class ByteArrayInputStreampublic int read(byte[] b,
int off,
int len)
read in class ByteArrayInputStreampublic long skip(long n)
skip in class ByteArrayInputStreampublic final int skipBytes(int n)
throws IOException
skipBytes in interface DataInputIOExceptionpublic int available()
available in class ByteArrayInputStreampublic boolean markSupported()
markSupported in class ByteArrayInputStreampublic void reset()
reset in class ByteArrayInputStreampublic void set(byte[] bytes,
int size)
public final boolean readBoolean()
throws IOException
readBoolean in interface DataInputIOExceptionpublic final byte readByte()
throws IOException
readByte method of
DataInput.
Bytes for this operation are read from the contained input stream.readByte in interface DataInputbyte.EOFException - if this input stream has reached the end.IOException - if an I/O error occurs.FilterInputStream.inpublic final char readChar()
throws IOException
readChar method of
DataInput.
Bytes for this operation are read from the contained input stream.readChar in interface DataInputEOFException - if this input stream reaches the end before reading two
bytes.IOException - if an I/O error occurs.FilterInputStream.inpublic final double readDouble()
throws IOException
readDouble method of
DataInput.
Bytes for this operation are read from the contained input stream.readDouble in interface DataInputdouble.EOFException - if this input stream reaches the end before reading eight
bytes.IOException - if an I/O error occurs.DataInputStream.readLong(),
Double.longBitsToDouble(long)public final float readFloat()
throws IOException
readFloat method of
DataInput.
Bytes for this operation are read from the contained input stream.readFloat in interface DataInputfloat.EOFException - if this input stream reaches the end before reading four
bytes.IOException - if an I/O error occurs.DataInputStream.readInt(),
Float.intBitsToFloat(int)public 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 final int readInt()
throws IOException
readInt method of
DataInput.
Bytes for this operation are read from the contained input stream.readInt in interface DataInputint.EOFException - if this input stream reaches the end before reading four
bytes.IOException - if an I/O error occurs.FilterInputStream.in@Deprecated public final String readLine() throws IOException
BufferedReader.readLine() method.
Programs that use the DataInputStream class to
read lines can be converted to use the
BufferedReader class by replacing code of the
form:
DataInputStream d = new DataInputStream(in);
with:
BufferedReader d = new BufferedReader(new InputStreamReader(in));
readLine method of
DataInput.
Bytes for this operation are read from the contained input stream.readLine in interface DataInputIOException - if an I/O error occurs.BufferedReader.readLine(),
FilterInputStream.inpublic final long readLong()
throws IOException
readLong method of
DataInput.
Bytes for this operation are read from the contained input stream.readLong in interface DataInputlong.EOFException - if this input stream reaches the end before reading eight
bytes.IOException - if an I/O error occurs.FilterInputStream.inpublic final short readShort()
throws IOException
readShort method of
DataInput.
Bytes for this operation are read from the contained input stream.readShort in interface DataInputEOFException - if this input stream reaches the end before reading two
bytes.IOException - if an I/O error occurs.FilterInputStream.inpublic final int readUnsignedByte()
throws IOException
readUnsignedByte method of
DataInput.
Bytes for this operation are read from the contained input stream.readUnsignedByte in interface DataInputEOFException - if this input stream has reached the end.IOException - if an I/O error occurs.FilterInputStream.inpublic final int readUnsignedShort()
throws IOException
readUnsignedShort method of
DataInput.
Bytes for this operation are read from the contained input stream.readUnsignedShort in interface DataInputEOFException - if this input stream reaches the end before reading two
bytes.IOException - if an I/O error occurs.FilterInputStream.inpublic final String readUTF() throws IOException
readUTF method of
DataInput.
Bytes for this operation are read from the contained input stream.readUTF in interface DataInputEOFException - if this input stream reaches the end before reading all
the bytes.IOException - if an I/O error occurs.UTFDataFormatException - if the bytes do not represent a valid modified UTF-8
encoding of a string.DataInputStream.readUTF(java.io.DataInput)Copyright © 2013 Hazelcast, Inc.. All rights reserved.