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 TypeMethodDescriptionintread(byte[] b) intread(byte[] b, int off, int len) booleanbytereadByte()charreadChar()doublefloatvoidreadFloats(float[] data, int len) Reads n floats into an array.voidreadFully(byte[] b) voidreadFully(byte[] b, int off, int len) intreadInt()voidreadInts(int[] data, int len) Reads n ints into an array.readLine()longreadLong()shortintintreadUTF()static StringintskipBytes(int n) Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skipMethods 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:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
skipBytes
- Specified by:
skipBytesin interfaceDataInput- Throws:
IOException
-
readBoolean
- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
readByte
- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readShort
- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readUnsignedShort
- Specified by:
readUnsignedShortin interfaceDataInput- Throws:
IOException
-
readChar
- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readInt
- Specified by:
readIntin 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:
readLongin interfaceDataInput- Throws:
IOException
-
readFloat
- Specified by:
readFloatin 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:
readDoublein interfaceDataInput- Throws:
IOException
-
readLine
- Specified by:
readLinein interfaceDataInput- Throws:
IOException
-
readUTF
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-
readUTF
- Throws:
IOException
-