Package org.xj3d.io
Class BlockDataInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.xj3d.io.BlockDataInputStream
- All Implemented Interfaces:
Closeable
,DataInput
,AutoCloseable
A data input stream which allows reading of arrays of primitive types as
well as the standard types a DataInputStream allows. This class is considerably
faster then the standard DataInputStream provided by the standard JDK.
This class is not thread safe. Do not call two methods at the same time.
- Version:
- $Revision: 1.1 $
- Author:
- Unknown
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a BlockDataInputStream that uses the specified underlying InputStream. -
Method Summary
Modifier and TypeMethodDescriptionint
read
(byte[] b) int
read
(byte[] b, int off, int len) boolean
byte
readByte()
char
readChar()
double
float
void
readFloats
(float[] data, int len) Reads n floats into an array.void
readFully
(byte[] b) void
readFully
(byte[] b, int off, int len) int
readInt()
void
readInts
(int[] data, int len) Reads n ints into an array.readLine()
long
readLong()
short
int
int
readUTF()
static String
int
skipBytes
(int n) Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
BlockDataInputStream
Creates a BlockDataInputStream that uses the specified underlying InputStream.- Parameters:
in
- the specified input stream
-
-
Method Details
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
readFully
- Specified by:
readFully
in interfaceDataInput
- Throws:
IOException
-
readFully
- Specified by:
readFully
in interfaceDataInput
- Throws:
IOException
-
skipBytes
- Specified by:
skipBytes
in interfaceDataInput
- Throws:
IOException
-
readBoolean
- Specified by:
readBoolean
in interfaceDataInput
- Throws:
IOException
-
readByte
- Specified by:
readByte
in interfaceDataInput
- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedByte
in interfaceDataInput
- Throws:
IOException
-
readShort
- Specified by:
readShort
in interfaceDataInput
- Throws:
IOException
-
readUnsignedShort
- Specified by:
readUnsignedShort
in interfaceDataInput
- Throws:
IOException
-
readChar
- Specified by:
readChar
in interfaceDataInput
- Throws:
IOException
-
readInt
- Specified by:
readInt
in interfaceDataInput
- Throws:
IOException
-
readInts
Reads n ints into an array. The array must be preallocated to at least n size.- Parameters:
data
- The place to store the datalen
- The number of floats to read.- Throws:
IOException
-
readLong
- Specified by:
readLong
in interfaceDataInput
- Throws:
IOException
-
readFloat
- Specified by:
readFloat
in interfaceDataInput
- Throws:
IOException
-
readFloats
Reads n floats into an array. The array must be preallocated to at least n size.- Parameters:
data
- The place to store the datalen
- The number of floats to read.- Throws:
IOException
-
readDouble
- Specified by:
readDouble
in interfaceDataInput
- Throws:
IOException
-
readLine
- Specified by:
readLine
in interfaceDataInput
- Throws:
IOException
-
readUTF
- Specified by:
readUTF
in interfaceDataInput
- Throws:
IOException
-
readUTF
- Throws:
IOException
-