Package com.xinapse.io
Class Input
java.lang.Object
com.xinapse.io.Input
Abstract class providing methods to read primitve data values from input sources.
The byte order of the data source can be specified for multi-byte primitive values.
-
Method Summary
Modifier and TypeMethodDescriptionstatic longBitSet(DataInputStream strm, BitSet bitSet) Reads aBitSetfrom aDataInputStreamstrm, ensuring that blocking occurs until all values have been read.static longBitSet(InputStream strm, BitSet bitSet) Reads aBitSetfrom aInputStreamstrmensuring that blocking occurs until all values have been read.static longBitSet(RandomAccessFile f, BitSet bitSet, int bitOffset) Reads aBitSetfrom aRandomAccessFilef, ensuring that blocking occurs until all values have been read.static byte[]ByteArray(InputStream strm, int nBytes) Reads an array of bytes from aInputStreamstrmensuring that blocking occurs until all values have been read.static byte[]ByteArray(RandomAccessFile f, int nBytes) Reads an array of bytes from aRandomAccessFilef, ensuring that blocking occurs until all values have been read.static doubleDouble(InputStream strm, ByteOrder byteOrder) Reads a double value from aInputStreamstrm, ensuring that blocking occurs until the value has been read.static doubleDouble(RandomAccessFile f, ByteOrder byteOrder) Reads a double value from aRandomAccessFilef, ensuring that blocking occurs until the value has been read.static double[]DoubleArray(InputStream strm, ByteOrder byteOrder, double[] dArray) Reads an array of double values from aDataInputStreamstrmensuring that blocking occurs until all values have been read.static double[]DoubleArray(InputStream strm, ByteOrder byteOrder, int nDoubles) Reads an array of double values from aInputStreamstrmensuring that blocking occurs until all values have been read.static double[]DoubleArray(RandomAccessFile f, ByteOrder byteOrder, double[] dArray) Reads an array of double values from aRandomAccessFilefensuring that blocking occurs until all values have been read.static double[]DoubleArray(RandomAccessFile f, ByteOrder byteOrder, double[] dArray, int off, int len) Reads an array of double values from aRandomAccessFilefensuring that blocking occurs until all values have been read.static floatFloat(InputStream strm, ByteOrder byteOrder) Reads a float value from aInputStreamstrm, ensuring that blocking occurs until the value has been read.static floatFloat(RandomAccessFile f, ByteOrder byteOrder) Reads a float value from aRandomAccessFilef, ensuring that blocking occurs until the value has been read.static float[]FloatArray(DataInputStream strm, ByteOrder byteOrder, float[] fArray) Reads an array of float values from aDataInputStreamstrmensuring that blocking occurs until all values have been read.static float[]FloatArray(InputStream strm, ByteOrder byteOrder, int nFloats) Reads an array of float values from aInputStreamstrmensuring that blocking occurs until all values have been read.static float[]FloatArray(RandomAccessFile f, ByteOrder byteOrder, float[] fArray) Reads an array of float values from aRandomAccessFilefensuring that blocking occurs until all values have been read.static float[]FloatArray(RandomAccessFile f, ByteOrder byteOrder, float[] fArray, int off, int len) Reads an array of float values from aRandomAccessFilefensuring that blocking occurs until all values have been read.static int[]IntArray(DataInputStream strm, ByteOrder byteOrder, int[] iArray) Reads an array of int values from aDataInputStreamstrmensuring that blocking occurs until all values have been read.static int[]IntArray(InputStream strm, ByteOrder byteOrder, int nInts) Reads an array of int values from aInputStreamstrmensuring that blocking occurs until all values have been read.static int[]IntArray(RandomAccessFile f, ByteOrder byteOrder, int[] iArray) Reads an array of int values from aRandomAccessFilefensuring that blocking occurs until all values have been read.static int[]IntArray(RandomAccessFile f, ByteOrder byteOrder, int[] iArray, int off, int len) Reads an array of int values from aRandomAccessFilefensuring that blocking occurs until all values have been read.static intInteger(byte[] b, int offset) Gets an int value from an array of 4 bytes.static intInteger(InputStream strm, ByteOrder byteOrder) Reads an integer value from aInputStreamstrm, ensuring that blocking occurs until the value has been read.static intInteger(RandomAccessFile f, ByteOrder byteOrder) Reads an integer value from aRandomAccessFilef, ensuring that blocking occurs until the value has been read.static longLong(InputStream strm, ByteOrder byteOrder) Reads a long value from aInputStreamstrm, ensuring that blocking occurs until the value has been read.static longLong(RandomAccessFile f, ByteOrder byteOrder) Reads a long value from aRandomAccessFilef, ensuring that blocking occurs until the value has been read.static long[]LongArray(DataInputStream strm, ByteOrder byteOrder, long[] lArray) Reads an array of long values from aDataInputStreamstrmensuring that blocking occurs until all values have been read.static long[]LongArray(InputStream strm, ByteOrder byteOrder, int nLongs) Reads an array of long values from aInputStreamstrmensuring that blocking occurs until all values have been read.static long[]LongArray(RandomAccessFile f, ByteOrder byteOrder, long[] lArray) Reads an array of long values from aRandomAccessFilefensuring that blocking occurs until all values have been read.static long[]LongArray(RandomAccessFile f, ByteOrder byteOrder, long[] lArray, int off, int len) Reads an array of long values from aRandomAccessFilef, ensuring that blocking occurs until all values have been read.static shortShort(InputStream strm, ByteOrder byteOrder) Reads ashortvalue from aInputStreamstrm, ensuring that blocking occurs until the value has been read.static shortShort(RandomAccessFile f, ByteOrder byteOrder) Reads ashortvalue from aRandomAccessFilef, ensuring that blocking occurs until the value has been read.static short[]ShortArray(DataInputStream strm, ByteOrder byteOrder, short[] sArray) Reads an array of short values from aDataInputStreamstrmensuring that blocking occurs until all values have been read.static short[]ShortArray(InputStream strm, ByteOrder byteOrder, int nShorts) Reads an array of short values from aInputStreamstrmensuring that blocking occurs until all values have been read.static short[]ShortArray(RandomAccessFile f, ByteOrder byteOrder, short[] sArray) Reads an array of short values from aRandomAccessFilefensuring that blocking occurs until all values have been read.static short[]ShortArray(RandomAccessFile f, ByteOrder byteOrder, short[] sArray, int off, int len) Reads an array of short values from aRandomAccessFilefensuring that blocking occurs until all values have been read.static StringString(InputStream strm, int nBytes) Reads a String from aInputStreamstrm, by decoding the bytes read using the Output.static StringString(InputStream strm, int nBytes, Charset charset) Reads a String from aInputStreamstrm, by decoding the bytes read using the specified charset and ensuring that blocking occurs until the String has been read.static StringString(RandomAccessFile f, int nBytes) Reads a String from aRandomAccessFilef, ensuring that blocking occurs until the String has been read.static longUInteger(InputStream strm, ByteOrder byteOrder) Reads an unsigned integer value from aRandomAccessFilef, ensuring that blocking occurs until the value has been read.static longUInteger(RandomAccessFile f, ByteOrder byteOrder) Reads an unsigned integer value from aRandomAccessFilef, ensuring that blocking occurs until the value has been read.static intUShort(byte[] b, int offset) Gets an int value from an array of 2 bytes.static intUShort(InputStream strm, ByteOrder byteOrder) Reads an unsigned short value from aInputStreamstrm, ensuring that blocking occurs until the value has been read.static intUShort(RandomAccessFile f, ByteOrder byteOrder) Reads an unsigned short value from aRandomAccessFilef, ensuring that blocking occurs until the value has been read.
-
Method Details
-
Short
Reads ashortvalue from aInputStreamstrm, ensuring that blocking occurs until the value has been read.- Parameters:
strm- theInputStreamfrom which the short value will be read.byteOrder- the ByteOrder of the data in theInputStream.- Returns:
- a
shortvalue read from theInputStream. - Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
Short
Reads ashortvalue from aRandomAccessFilef, ensuring that blocking occurs until the value has been read.- Parameters:
f- the RandomAccessFile from which the short value will be read.byteOrder- the ByteOrder of the data in the RandomAccessFile.- Returns:
- a
shortvalue read from the RandomAccessFile. - Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
UShort
Reads an unsigned short value from aInputStreamstrm, ensuring that blocking occurs until the value has been read.- Parameters:
strm- theInputStreamfrom which the unsigned short value will be read.byteOrder- the ByteOrder of the data in theInputStream.- Returns:
- a unsigned short value read from the
InputStream, as an int. - Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
UShort
Reads an unsigned short value from aRandomAccessFilef, ensuring that blocking occurs until the value has been read.- Parameters:
f- the RandomAccessFile from which the unsigned short value will be read.byteOrder- the ByteOrder of the data in the RandomAccessFile.- Returns:
- an unsigned short value read from the RandomAccessFile, as an int.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
UShort
public static int UShort(byte[] b, int offset) Gets an int value from an array of 2 bytes. The bytes are assumed to be in big-endian order.- Parameters:
b- the byte[] of length at least 2+offset from which the unsigned short value will be created.offset- the offset into the array at which reading of the byte values will begin.- Returns:
- an int value created from 2 bytes representing an unsigned short value.
-
Integer
Reads an integer value from aInputStreamstrm, ensuring that blocking occurs until the value has been read.- Parameters:
strm- theInputStreamfrom which the int value will be read.byteOrder- the ByteOrder of the data in theInputStream.- Returns:
- an int value read from the
InputStream. - Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
Integer
Reads an integer value from aRandomAccessFilef, ensuring that blocking occurs until the value has been read.- Parameters:
f- the RandomAccessFile from which the integer value will be read.byteOrder- the ByteOrder of the data in the RandomAccessFile.- Returns:
- an int value read from the RandomAccessFile.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
Integer
public static int Integer(byte[] b, int offset) Gets an int value from an array of 4 bytes. The bytes are assumed to be in big-endian order.- Parameters:
b- the byte[] of length at least 4+offset from which the integer value will be created.offset- the offset into the array at which reading of the byte values will begin.- Returns:
- an int value created from 4 bytes.
-
UInteger
Reads an unsigned integer value from aRandomAccessFilef, ensuring that blocking occurs until the value has been read.- Parameters:
strm- theInputStreamfrom which the unsigned int value will be read.byteOrder- the ByteOrder of the data in the RandomAccessFile.- Returns:
- an unsigned int value read from the RandomAccessFile, as a long.
- Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
UInteger
public static long UInteger(RandomAccessFile f, ByteOrder byteOrder) throws EOFException, IOException Reads an unsigned integer value from aRandomAccessFilef, ensuring that blocking occurs until the value has been read.- Parameters:
f- the RandomAccessFile from which the unsigned int value will be read.byteOrder- the ByteOrder of the data in the RandomAccessFile.- Returns:
- an unsigned int value read from the RandomAccessFile, as a long.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
Long
Reads a long value from aInputStreamstrm, ensuring that blocking occurs until the value has been read.- Parameters:
strm- theInputStreamfrom which the long value will be read.byteOrder- the ByteOrder of the data in theInputStream.- Returns:
- a long value read from the
InputStream. - Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
Long
Reads a long value from aRandomAccessFilef, ensuring that blocking occurs until the value has been read.- Parameters:
f- the RandomAccessFile from which the long value will be read.byteOrder- the ByteOrder of the data in the RandomAccessFile.- Returns:
- a long value read from the RandomAccessFile.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
Float
Reads a float value from aInputStreamstrm, ensuring that blocking occurs until the value has been read.- Parameters:
strm- theInputStreamfrom which the float value will be read.byteOrder- the ByteOrder of the data in theInputStream.- Returns:
- a float value read from the
InputStream. - Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
Float
Reads a float value from aRandomAccessFilef, ensuring that blocking occurs until the value has been read.- Parameters:
f- the RandomAccessFile from which the float value will be read.byteOrder- the ByteOrder of the data in the RandomAccessFile.- Returns:
- a float value read from the RandomAccessFile.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
Double
Reads a double value from aInputStreamstrm, ensuring that blocking occurs until the value has been read.- Parameters:
strm- theInputStreamfrom which the double value will be read.byteOrder- the ByteOrder of the data in theInputStream.- Returns:
- a double value read from the
InputStream. - Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
Double
public static double Double(RandomAccessFile f, ByteOrder byteOrder) throws EOFException, IOException Reads a double value from aRandomAccessFilef, ensuring that blocking occurs until the value has been read.- Parameters:
f- the RandomAccessFile from which the double value will be read.byteOrder- the ByteOrder of the data in the RandomAccessFile.- Returns:
- a double value read from the RandomAccessFile.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
String
Reads a String from aInputStreamstrm, by decoding the bytes read using the Output. DEFAULT_CHARSET charset and ensuring that blocking occurs until the String has been read.- Parameters:
strm- theInputStreamfrom which the String will be read.nBytes- the length of the String, in bytes.- Returns:
- a String value read from the
InputStream. - Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
String
public static String String(InputStream strm, int nBytes, Charset charset) throws EOFException, IOException Reads a String from aInputStreamstrm, by decoding the bytes read using the specified charset and ensuring that blocking occurs until the String has been read.- Parameters:
strm- theInputStreamfrom which the String will be read.nBytes- the length of the String, in bytes.charset- the Charset to use for decoding.- Returns:
- a String value read from the
InputStream. - Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
String
Reads a String from aRandomAccessFilef, ensuring that blocking occurs until the String has been read.- Parameters:
f- the RandomAccessFile from which the String will be read.nBytes- the length of the String, in bytes.- Returns:
- a String value read from the RandomAccessFile.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
ByteArray
Reads an array of bytes from aInputStreamstrmensuring that blocking occurs until all values have been read.- Parameters:
strm- theInputStreamfrom which the bytes will be read.nBytes- the number of bytes to read.- Returns:
- an array of bytes read from the
InputStream. - Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
ByteArray
Reads an array of bytes from aRandomAccessFilef, ensuring that blocking occurs until all values have been read.- Parameters:
f- the RandomAccessFile from which the bytes will be read.nBytes- the number of bytes to read.- Returns:
- an array of bytes read from the RandomAccessFile.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
BitSet
Reads aBitSetfrom aInputStreamstrmensuring that blocking occurs until all values have been read.- Parameters:
strm- theInputStreamfrom which the boolean (binary) values will be read.bitSet- theBitSetthat will be filled by this method. The number of values to be read is specified by the length ofbitSet.- Returns:
- the number of bytes read (rounded up to the next byte if a whole number of bytes is not read).
- Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
BitSet
Reads aBitSetfrom aDataInputStreamstrm, ensuring that blocking occurs until all values have been read.- Parameters:
strm- the DataInputStream from which the boolean (binary) values will be read.bitSet- theBitSetthat will be filled by this method. The number of values to be read is specified by the length ofbitSet.- Returns:
- the number of bytes read (rounded up to the next byte if a whole number of bytes is not read).
- Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
BitSet
Reads aBitSetfrom aRandomAccessFilef, ensuring that blocking occurs until all values have been read.- Parameters:
f- the RandomAccessFile from which the boolean (binary) values will be read.bitSet- theBitSetthat will be filled by this method. The number of values to be read is specified by the length ofbitSet.bitOffset- an offset (in bits) from the current location in the RandomAccessFile to the point where reading bits should start.- Returns:
- the number of bytes read (rounded up to the next byte if a whole number of bytes is not read).
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
ShortArray
public static short[] ShortArray(InputStream strm, ByteOrder byteOrder, int nShorts) throws EOFException, IOException Reads an array of short values from aInputStreamstrmensuring that blocking occurs until all values have been read.- Parameters:
strm- theInputStreamfrom which the short values will be read.byteOrder- the ByteOrder of the data in theInputStream.nShorts- the number of short values to read.- Returns:
- an array of short values read from the
InputStream. - Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
ShortArray
public static short[] ShortArray(DataInputStream strm, ByteOrder byteOrder, short[] sArray) throws IOException, EOFException Reads an array of short values from aDataInputStreamstrmensuring that blocking occurs until all values have been read.- Parameters:
strm- the DataInputStream from which the short values will be read.byteOrder- the ByteOrder of the data in theInputStream.sArray- the array into which the short values read will be stored.- Returns:
- the supplied array.
- Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O occurs during the read.
-
ShortArray
public static short[] ShortArray(RandomAccessFile f, ByteOrder byteOrder, short[] sArray) throws IOException, EOFException Reads an array of short values from aRandomAccessFilefensuring that blocking occurs until all values have been read.- Parameters:
f- the RandomAccessFile from which the short values will be read.byteOrder- the ByteOrder of the data in theInputStream.sArray- the array into which the short values read will be stored.- Returns:
- the supplied array.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
ShortArray
public static short[] ShortArray(RandomAccessFile f, ByteOrder byteOrder, short[] sArray, int off, int len) throws IOException, EOFException Reads an array of short values from aRandomAccessFilefensuring that blocking occurs until all values have been read.- Parameters:
f- the RandomAccessFile from which the short values will be read.byteOrder- the ByteOrder of the data in theInputStream.sArray- the array into which the short values read will be stored.off- the offset into the array (a number of short values) at which the storage of the values read will start.len- the number of short values to read from the RandomAccessFile.- Returns:
- the supplied array.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
IntArray
public static int[] IntArray(InputStream strm, ByteOrder byteOrder, int nInts) throws EOFException, IOException Reads an array of int values from aInputStreamstrmensuring that blocking occurs until all values have been read.- Parameters:
strm- theInputStreamfrom which the int values will be read.byteOrder- the ByteOrder of the data in theInputStream.nInts- the number of int values to read.- Returns:
- an array of int values read from the
InputStream. - Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
IntArray
public static int[] IntArray(DataInputStream strm, ByteOrder byteOrder, int[] iArray) throws IOException Reads an array of int values from aDataInputStreamstrmensuring that blocking occurs until all values have been read.- Parameters:
strm- the DataInputStream from which the int values will be read.byteOrder- the ByteOrder of the data in theInputStream.iArray- the array into which the int values read will be stored.- Returns:
- the supplied array.
- Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
IntArray
public static int[] IntArray(RandomAccessFile f, ByteOrder byteOrder, int[] iArray) throws IOException Reads an array of int values from aRandomAccessFilefensuring that blocking occurs until all values have been read.- Parameters:
f- the RandomAccessFile from which the int values will be read.byteOrder- the ByteOrder of the data in theInputStream.iArray- the array into which the int values read will be stored.- Returns:
- the supplied array.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
IntArray
public static int[] IntArray(RandomAccessFile f, ByteOrder byteOrder, int[] iArray, int off, int len) throws IOException Reads an array of int values from aRandomAccessFilefensuring that blocking occurs until all values have been read.- Parameters:
f- the RandomAccessFile from which the int values will be read.byteOrder- the ByteOrder of the data in theInputStream.iArray- the array into which the int values read will be stored.off- the offset into the array (a number of int values) at which the storage of the values read will start.len- the number of int values to read from the RandomAccessFile.- Returns:
- the supplied array.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
LongArray
public static long[] LongArray(InputStream strm, ByteOrder byteOrder, int nLongs) throws EOFException, IOException Reads an array of long values from aInputStreamstrmensuring that blocking occurs until all values have been read.- Parameters:
strm- theInputStreamfrom which the int values will be read.byteOrder- the ByteOrder of the data in theInputStream.nLongs- the number of long values to read.- Returns:
- an array of long values read from the
InputStream. - Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
LongArray
public static long[] LongArray(DataInputStream strm, ByteOrder byteOrder, long[] lArray) throws IOException Reads an array of long values from aDataInputStreamstrmensuring that blocking occurs until all values have been read.- Parameters:
strm- the DataInputStream from which the long values will be read.byteOrder- the ByteOrder of the data in theInputStream.lArray- the array into which the long values read will be stored.- Returns:
- an array of long values read from the
DataInputStream. - Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
LongArray
public static long[] LongArray(RandomAccessFile f, ByteOrder byteOrder, long[] lArray) throws IOException Reads an array of long values from aRandomAccessFilefensuring that blocking occurs until all values have been read.- Parameters:
f- the RandomAccessFile from which the long values will be read.byteOrder- theByteOrderof the data in theInputStream.lArray- the array into which the long values read will be stored.- Returns:
- the supplied array.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
LongArray
public static long[] LongArray(RandomAccessFile f, ByteOrder byteOrder, long[] lArray, int off, int len) throws IOException Reads an array of long values from aRandomAccessFilef, ensuring that blocking occurs until all values have been read.- Parameters:
f- the RandomAccessFile from which the long values will be read.byteOrder- theByteOrderof the data in theInputStream.lArray- the array into which the long values read will be stored.off- the offset into the array (a number of long values) at which the storage of the values read will start.len- the number of long values to read from the RandomAccessFile.- Returns:
- the supplied array.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
FloatArray
public static float[] FloatArray(InputStream strm, ByteOrder byteOrder, int nFloats) throws EOFException, IOException Reads an array of float values from aInputStreamstrmensuring that blocking occurs until all values have been read.- Parameters:
strm- theInputStreamfrom which the float values will be read.byteOrder- the ByteOrder of the data in theInputStream.nFloats- the number of float values to read.- Returns:
- an array of float values read from the
InputStream. - Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
FloatArray
public static float[] FloatArray(DataInputStream strm, ByteOrder byteOrder, float[] fArray) throws IOException Reads an array of float values from aDataInputStreamstrmensuring that blocking occurs until all values have been read.- Parameters:
strm- the DataInputStream from which the float values will be read.byteOrder- the ByteOrder of the data in theInputStream.fArray- the array into which the float values read will be stored.- Returns:
- the supplied array.
- Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
FloatArray
public static float[] FloatArray(RandomAccessFile f, ByteOrder byteOrder, float[] fArray) throws IOException Reads an array of float values from aRandomAccessFilefensuring that blocking occurs until all values have been read.- Parameters:
f- the RandomAccessFile from which the float values will be read.byteOrder- the ByteOrder of the data in theInputStream.fArray- the array into which the float values read will be stored.- Returns:
- the supplied array.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
FloatArray
public static float[] FloatArray(RandomAccessFile f, ByteOrder byteOrder, float[] fArray, int off, int len) throws IOException Reads an array of float values from aRandomAccessFilefensuring that blocking occurs until all values have been read.- Parameters:
f- the RandomAccessFile from which the float values will be read.byteOrder- the ByteOrder of the data in theInputStream.fArray- the array into which the float values read will be stored.off- the offset into the array (a number of float values) at which the storage of the values read will start.len- the number of float values to read from the RandomAccessFile.- Returns:
- the supplied array.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
DoubleArray
public static double[] DoubleArray(InputStream strm, ByteOrder byteOrder, int nDoubles) throws EOFException, IOException Reads an array of double values from aInputStreamstrmensuring that blocking occurs until all values have been read.- Parameters:
strm- theInputStreamfrom which the double values will be read.byteOrder- the ByteOrder of the data in theInputStream.nDoubles- the number of double values to read.- Returns:
- an array of double values read from the
InputStream. - Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
DoubleArray
public static double[] DoubleArray(InputStream strm, ByteOrder byteOrder, double[] dArray) throws IOException Reads an array of double values from aDataInputStreamstrmensuring that blocking occurs until all values have been read.- Parameters:
strm- the DataInputStream from which the double values will be read.byteOrder- the ByteOrder of the data in theInputStream.dArray- the array into which the double values read will be stored.- Returns:
- an array of double values read from the
InputStream. - Throws:
EOFException- if the end of the stream is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
DoubleArray
public static double[] DoubleArray(RandomAccessFile f, ByteOrder byteOrder, double[] dArray) throws IOException Reads an array of double values from aRandomAccessFilefensuring that blocking occurs until all values have been read.- Parameters:
f- the RandomAccessFile from which the double values will be read.byteOrder- the ByteOrder of the data in theInputStream.dArray- the array into which the double values read will be stored.- Returns:
- the supplied array.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-
DoubleArray
public static double[] DoubleArray(RandomAccessFile f, ByteOrder byteOrder, double[] dArray, int off, int len) throws IOException Reads an array of double values from aRandomAccessFilefensuring that blocking occurs until all values have been read.- Parameters:
f- the RandomAccessFile from which the double values will be read.byteOrder- the ByteOrder of the data in theInputStream.dArray- the array into which the double values read will be stored.off- the offset into the array (a number of double values) at which the storage of the values read will start.len- the number of double values to read from the RandomAccessFile.- Returns:
- the supplied array.
- Throws:
EOFException- if the end of the file is reached before reading is completed.IOException- if an I/O error occurs during the read.
-