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:DataInputStream d = new DataInputStream(in); BufferedReader d = new BufferedReader(new InputStreamReader(in)); |
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, mark
read
public FastByteArrayInputStream(byte[] buf)
public FastByteArrayInputStream(byte[] buf, int offset, int length)
public int read()
read
in class ByteArrayInputStream
public int read(byte[] b, int off, int len)
read
in class ByteArrayInputStream
public long skip(long n)
skip
in class ByteArrayInputStream
public final int skipBytes(int n) throws IOException
skipBytes
in interface DataInput
IOException
public int available()
available
in class ByteArrayInputStream
public boolean markSupported()
markSupported
in class ByteArrayInputStream
public void reset()
reset
in class ByteArrayInputStream
public void set(byte[] bytes, int size)
public final boolean readBoolean() throws IOException
readBoolean
in interface DataInput
IOException
public final byte readByte() throws IOException
readByte
method of
DataInput
.
Bytes for this operation are read from the contained input stream.readByte
in interface DataInput
byte
.EOFException
- if this input stream has reached the end.IOException
- if an I/O error occurs.FilterInputStream.in
public final char readChar() throws IOException
readChar
method of
DataInput
.
Bytes for this operation are read from the contained input stream.readChar
in interface DataInput
EOFException
- if this input stream reaches the end before reading two
bytes.IOException
- if an I/O error occurs.FilterInputStream.in
public final double readDouble() throws IOException
readDouble
method of
DataInput
.
Bytes for this operation are read from the contained input stream.readDouble
in interface DataInput
double
.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 DataInput
float
.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 DataInput
IOException
public final void readFully(byte[] b, int off, int len) throws IOException
readFully
in interface DataInput
IOException
public final int readInt() throws IOException
readInt
method of
DataInput
.
Bytes for this operation are read from the contained input stream.readInt
in interface DataInput
int
.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: with:DataInputStream d = new DataInputStream(in);
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 DataInput
IOException
- if an I/O error occurs.BufferedReader.readLine()
,
FilterInputStream.in
public final long readLong() throws IOException
readLong
method of
DataInput
.
Bytes for this operation are read from the contained input stream.readLong
in interface DataInput
long
.EOFException
- if this input stream reaches the end before reading eight
bytes.IOException
- if an I/O error occurs.FilterInputStream.in
public final short readShort() throws IOException
readShort
method of
DataInput
.
Bytes for this operation are read from the contained input stream.readShort
in interface DataInput
EOFException
- if this input stream reaches the end before reading two
bytes.IOException
- if an I/O error occurs.FilterInputStream.in
public final int readUnsignedByte() throws IOException
readUnsignedByte
method of
DataInput
.
Bytes for this operation are read from the contained input stream.readUnsignedByte
in interface DataInput
EOFException
- if this input stream has reached the end.IOException
- if an I/O error occurs.FilterInputStream.in
public final int readUnsignedShort() throws IOException
readUnsignedShort
method of
DataInput
.
Bytes for this operation are read from the contained input stream.readUnsignedShort
in interface DataInput
EOFException
- if this input stream reaches the end before reading two
bytes.IOException
- if an I/O error occurs.FilterInputStream.in
public final String readUTF() throws IOException
readUTF
method of
DataInput
.
Bytes for this operation are read from the contained input stream.readUTF
in interface DataInput
EOFException
- 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.