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 long
BitSet
(DataInputStream strm, BitSet bitSet) Reads aBitSet
from aDataInputStream
strm
, ensuring that blocking occurs until all values have been read.static long
BitSet
(InputStream strm, BitSet bitSet) Reads aBitSet
from aInputStream
strm
ensuring that blocking occurs until all values have been read.static long
BitSet
(RandomAccessFile f, BitSet bitSet, int bitOffset) Reads aBitSet
from aRandomAccessFile
f
, ensuring that blocking occurs until all values have been read.static byte[]
ByteArray
(InputStream strm, int nBytes) Reads an array of bytes from aInputStream
strm
ensuring that blocking occurs until all values have been read.static byte[]
ByteArray
(RandomAccessFile f, int nBytes) Reads an array of bytes from aRandomAccessFile
f
, ensuring that blocking occurs until all values have been read.static double
Double
(InputStream strm, ByteOrder byteOrder) Reads a double value from aInputStream
strm
, ensuring that blocking occurs until the value has been read.static double
Double
(RandomAccessFile f, ByteOrder byteOrder) Reads a double value from aRandomAccessFile
f
, 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 aDataInputStream
strm
ensuring 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 aInputStream
strm
ensuring 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 aRandomAccessFile
f
ensuring 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 aRandomAccessFile
f
ensuring that blocking occurs until all values have been read.static float
Float
(InputStream strm, ByteOrder byteOrder) Reads a float value from aInputStream
strm
, ensuring that blocking occurs until the value has been read.static float
Float
(RandomAccessFile f, ByteOrder byteOrder) Reads a float value from aRandomAccessFile
f
, 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 aDataInputStream
strm
ensuring 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 aInputStream
strm
ensuring 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 aRandomAccessFile
f
ensuring 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 aRandomAccessFile
f
ensuring 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 aDataInputStream
strm
ensuring 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 aInputStream
strm
ensuring 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 aRandomAccessFile
f
ensuring 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 aRandomAccessFile
f
ensuring that blocking occurs until all values have been read.static int
Integer
(byte[] b, int offset) Gets an int value from an array of 4 bytes.static int
Integer
(InputStream strm, ByteOrder byteOrder) Reads an integer value from aInputStream
strm
, ensuring that blocking occurs until the value has been read.static int
Integer
(RandomAccessFile f, ByteOrder byteOrder) Reads an integer value from aRandomAccessFile
f
, ensuring that blocking occurs until the value has been read.static long
Long
(InputStream strm, ByteOrder byteOrder) Reads a long value from aInputStream
strm
, ensuring that blocking occurs until the value has been read.static long
Long
(RandomAccessFile f, ByteOrder byteOrder) Reads a long value from aRandomAccessFile
f
, 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 aDataInputStream
strm
ensuring 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 aInputStream
strm
ensuring 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 aRandomAccessFile
f
ensuring 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 aRandomAccessFile
f
, ensuring that blocking occurs until all values have been read.static short
Short
(InputStream strm, ByteOrder byteOrder) Reads ashort
value from aInputStream
strm
, ensuring that blocking occurs until the value has been read.static short
Short
(RandomAccessFile f, ByteOrder byteOrder) Reads ashort
value from aRandomAccessFile
f
, 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 aDataInputStream
strm
ensuring 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 aInputStream
strm
ensuring 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 aRandomAccessFile
f
ensuring 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 aRandomAccessFile
f
ensuring that blocking occurs until all values have been read.static String
String
(InputStream strm, int nBytes) Reads a String from aInputStream
strm
, by decoding the bytes read using the Output.static String
String
(InputStream strm, int nBytes, Charset charset) Reads a String from aInputStream
strm
, by decoding the bytes read using the specified charset and ensuring that blocking occurs until the String has been read.static String
String
(RandomAccessFile f, int nBytes) Reads a String from aRandomAccessFile
f
, ensuring that blocking occurs until the String has been read.static long
UInteger
(InputStream strm, ByteOrder byteOrder) Reads an unsigned integer value from aRandomAccessFile
f
, ensuring that blocking occurs until the value has been read.static long
UInteger
(RandomAccessFile f, ByteOrder byteOrder) Reads an unsigned integer value from aRandomAccessFile
f
, ensuring that blocking occurs until the value has been read.static int
UShort
(byte[] b, int offset) Gets an int value from an array of 2 bytes.static int
UShort
(InputStream strm, ByteOrder byteOrder) Reads an unsigned short value from aInputStream
strm
, ensuring that blocking occurs until the value has been read.static int
UShort
(RandomAccessFile f, ByteOrder byteOrder) Reads an unsigned short value from aRandomAccessFile
f
, ensuring that blocking occurs until the value has been read.
-
Method Details
-
Short
Reads ashort
value from aInputStream
strm
, ensuring that blocking occurs until the value has been read.- Parameters:
strm
- theInputStream
from which the short value will be read.byteOrder
- the ByteOrder of the data in theInputStream
.- Returns:
- a
short
value 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 ashort
value from aRandomAccessFile
f
, 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
short
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.
-
UShort
Reads an unsigned short value from aInputStream
strm
, ensuring that blocking occurs until the value has been read.- Parameters:
strm
- theInputStream
from 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 aRandomAccessFile
f
, 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 aInputStream
strm
, ensuring that blocking occurs until the value has been read.- Parameters:
strm
- theInputStream
from 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 aRandomAccessFile
f
, 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 aRandomAccessFile
f
, ensuring that blocking occurs until the value has been read.- Parameters:
strm
- theInputStream
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 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 aRandomAccessFile
f
, 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 aInputStream
strm
, ensuring that blocking occurs until the value has been read.- Parameters:
strm
- theInputStream
from 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 aRandomAccessFile
f
, 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 aInputStream
strm
, ensuring that blocking occurs until the value has been read.- Parameters:
strm
- theInputStream
from 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 aRandomAccessFile
f
, 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 aInputStream
strm
, ensuring that blocking occurs until the value has been read.- Parameters:
strm
- theInputStream
from 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 aRandomAccessFile
f
, 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 aInputStream
strm
, by decoding the bytes read using the Output. DEFAULT_CHARSET charset and ensuring that blocking occurs until the String has been read.- Parameters:
strm
- theInputStream
from 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 aInputStream
strm
, by decoding the bytes read using the specified charset and ensuring that blocking occurs until the String has been read.- Parameters:
strm
- theInputStream
from 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 aRandomAccessFile
f
, 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 aInputStream
strm
ensuring that blocking occurs until all values have been read.- Parameters:
strm
- theInputStream
from 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 aRandomAccessFile
f
, 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 aBitSet
from aInputStream
strm
ensuring that blocking occurs until all values have been read.- Parameters:
strm
- theInputStream
from which the boolean (binary) values will be read.bitSet
- theBitSet
that 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 aBitSet
from aDataInputStream
strm
, ensuring that blocking occurs until all values have been read.- Parameters:
strm
- the DataInputStream from which the boolean (binary) values will be read.bitSet
- theBitSet
that 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 aBitSet
from aRandomAccessFile
f
, ensuring that blocking occurs until all values have been read.- Parameters:
f
- the RandomAccessFile from which the boolean (binary) values will be read.bitSet
- theBitSet
that 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 aInputStream
strm
ensuring that blocking occurs until all values have been read.- Parameters:
strm
- theInputStream
from 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 aDataInputStream
strm
ensuring 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 aRandomAccessFile
f
ensuring 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 aRandomAccessFile
f
ensuring 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 aInputStream
strm
ensuring that blocking occurs until all values have been read.- Parameters:
strm
- theInputStream
from 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 aDataInputStream
strm
ensuring 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 aRandomAccessFile
f
ensuring 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 aRandomAccessFile
f
ensuring 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 aInputStream
strm
ensuring that blocking occurs until all values have been read.- Parameters:
strm
- theInputStream
from 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 aDataInputStream
strm
ensuring 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 aRandomAccessFile
f
ensuring that blocking occurs until all values have been read.- Parameters:
f
- the RandomAccessFile from which the long values will be read.byteOrder
- theByteOrder
of 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 aRandomAccessFile
f
, ensuring that blocking occurs until all values have been read.- Parameters:
f
- the RandomAccessFile from which the long values will be read.byteOrder
- theByteOrder
of 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 aInputStream
strm
ensuring that blocking occurs until all values have been read.- Parameters:
strm
- theInputStream
from 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 aDataInputStream
strm
ensuring 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 aRandomAccessFile
f
ensuring 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 aRandomAccessFile
f
ensuring 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 aInputStream
strm
ensuring that blocking occurs until all values have been read.- Parameters:
strm
- theInputStream
from 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 aDataInputStream
strm
ensuring 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 aRandomAccessFile
f
ensuring 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 aRandomAccessFile
f
ensuring 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.
-