com.xinapse.io
Class Input

java.lang.Object
  extended by com.xinapse.io.Input

public abstract class Input
extends java.lang.Object

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
static long BitSet(java.io.DataInputStream strm, BitSet bitSet)
          Reads a com.xinapse.util.BitSet from a DataInputStream strm, ensuring that blocking occurs until all values have been read.
static long BitSet(java.io.InputStream strm, BitSet bitSet)
          Reads a com.xinapse.util.BitSet from a java.io.InputStream strm ensuring that blocking occurs until all values have been read.
static long BitSet(java.io.RandomAccessFile f, BitSet bitSet, int bitOffset)
          Reads a com.xinapse.util.BitSet from a java.io.RandomAccessFile f, ensuring that blocking occurs until all values have been read.
static byte[] ByteArray(java.io.InputStream strm, int nBytes)
          Reads an array of bytes from a java.io.InputStream strm ensuring that blocking occurs until all values have been read.
static byte[] ByteArray(java.io.RandomAccessFile f, int nBytes)
          Reads an array of bytes from a java.io.RandomAccessFile f, ensuring that blocking occurs until all values have been read.
static double Double(java.io.InputStream strm, java.nio.ByteOrder byteOrder)
          Reads a double value from a java.io.InputStream strm, ensuring that blocking occurs until the value has been read.
static double Double(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Reads a double value from a java.io.RandomAccessFile f, ensuring that blocking occurs until the value has been read.
static double[] DoubleArray(java.io.InputStream strm, java.nio.ByteOrder byteOrder, double[] dArray)
          Reads an array of double values from a DataInputStream strm ensuring that blocking occurs until all values have been read.
static double[] DoubleArray(java.io.InputStream strm, java.nio.ByteOrder byteOrder, int nDoubles)
          Reads an array of double values from a java.io.InputStream strm ensuring that blocking occurs until all values have been read.
static double[] DoubleArray(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder, double[] dArray)
          Reads an array of double values from a java.io.RandomAccessFile f ensuring that blocking occurs until all values have been read.
static double[] DoubleArray(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder, double[] dArray, int off, int len)
          Reads an array of double values from a java.io.RandomAccessFile f ensuring that blocking occurs until all values have been read.
static float Float(java.io.InputStream strm, java.nio.ByteOrder byteOrder)
          Reads a float value from a java.io.InputStream strm, ensuring that blocking occurs until the value has been read.
static float Float(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Reads a float value from a java.io.RandomAccessFile f, ensuring that blocking occurs until the value has been read.
static float[] FloatArray(java.io.DataInputStream strm, java.nio.ByteOrder byteOrder, float[] fArray)
          Reads an array of float values from a DataInputStream strm ensuring that blocking occurs until all values have been read.
static float[] FloatArray(java.io.InputStream strm, java.nio.ByteOrder byteOrder, int nFloats)
          Reads an array of float values from a java.io.InputStream strm ensuring that blocking occurs until all values have been read.
static float[] FloatArray(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder, float[] fArray)
          Reads an array of float values from a java.io.RandomAccessFile f ensuring that blocking occurs until all values have been read.
static float[] FloatArray(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder, float[] fArray, int off, int len)
          Reads an array of float values from a java.io.RandomAccessFile f ensuring that blocking occurs until all values have been read.
static int[] IntArray(java.io.DataInputStream strm, java.nio.ByteOrder byteOrder, int[] iArray)
          Reads an array of int values from a DataInputStream strm ensuring that blocking occurs until all values have been read.
static int[] IntArray(java.io.InputStream strm, java.nio.ByteOrder byteOrder, int nInts)
          Reads an array of int values from a java.io.InputStream strm ensuring that blocking occurs until all values have been read.
static int[] IntArray(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder, int[] iArray)
          Reads an array of int values from a java.io.RandomAccessFile f ensuring that blocking occurs until all values have been read.
static int[] IntArray(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder, int[] iArray, int off, int len)
          Reads an array of int values from a java.io.RandomAccessFile 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(java.io.InputStream strm, java.nio.ByteOrder byteOrder)
          Reads an integer value from a java.io.InputStream strm, ensuring that blocking occurs until the value has been read.
static int Integer(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Reads an integer value from a java.io.RandomAccessFile f, ensuring that blocking occurs until the value has been read.
static long Long(java.io.InputStream strm, java.nio.ByteOrder byteOrder)
          Reads a long value from a java.io.InputStream strm, ensuring that blocking occurs until the value has been read.
static long Long(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Reads a long value from a java.io.RandomAccessFile f, ensuring that blocking occurs until the value has been read.
static long[] LongArray(java.io.DataInputStream strm, java.nio.ByteOrder byteOrder, long[] lArray)
          Reads an array of long values from a DataInputStream strm ensuring that blocking occurs until all values have been read.
static long[] LongArray(java.io.InputStream strm, java.nio.ByteOrder byteOrder, int nLongs)
          Reads an array of long values from a java.io.InputStream strm ensuring that blocking occurs until all values have been read.
static long[] LongArray(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder, long[] lArray)
          Reads an array of long values from a java.io.RandomAccessFile f ensuring that blocking occurs until all values have been read.
static long[] LongArray(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder, long[] lArray, int off, int len)
          Reads an array of long values from a java.io.RandomAccessFile f, ensuring that blocking occurs until all values have been read.
static short Short(java.io.InputStream strm, java.nio.ByteOrder byteOrder)
          Reads a short value from a java.io.InputStream strm, ensuring that blocking occurs until the value has been read.
static short Short(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Reads a short value from a java.io.RandomAccessFile f, ensuring that blocking occurs until the value has been read.
static short[] ShortArray(java.io.DataInputStream strm, java.nio.ByteOrder byteOrder, short[] sArray)
          Reads an array of short values from a DataInputStream strm ensuring that blocking occurs until all values have been read.
static short[] ShortArray(java.io.InputStream strm, java.nio.ByteOrder byteOrder, int nShorts)
          Reads an array of short values from a java.io.InputStream strm ensuring that blocking occurs until all values have been read.
static short[] ShortArray(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder, short[] sArray)
          Reads an array of short values from a java.io.RandomAccessFile f ensuring that blocking occurs until all values have been read.
static short[] ShortArray(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder, short[] sArray, int off, int len)
          Reads an array of short values from a java.io.RandomAccessFile f ensuring that blocking occurs until all values have been read.
static java.lang.String String(java.io.InputStream strm, int nBytes)
          Reads a String from a java.io.InputStream strm, by decoding the bytes read using the Output.
static java.lang.String String(java.io.InputStream strm, int nBytes, java.nio.charset.Charset charset)
          Reads a String from a java.io.InputStream strm, by decoding the bytes read using the specified charset and ensuring that blocking occurs until the String has been read.
static java.lang.String String(java.io.RandomAccessFile f, int nBytes)
          Reads a String from a java.io.RandomAccessFile f, ensuring that blocking occurs until the String has been read.
static long UInteger(java.io.InputStream strm, java.nio.ByteOrder byteOrder)
          Reads an unsigned integer value from a java.io.RandomAccessFile f, ensuring that blocking occurs until the value has been read.
static long UInteger(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Reads an unsigned integer value from a java.io.RandomAccessFile 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(java.io.InputStream strm, java.nio.ByteOrder byteOrder)
          Reads an unsigned short value from a java.io.InputStream strm, ensuring that blocking occurs until the value has been read.
static int UShort(java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Reads an unsigned short value from a java.io.RandomAccessFile f, ensuring that blocking occurs until the value has been read.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

Short

public static short Short(java.io.InputStream strm,
                          java.nio.ByteOrder byteOrder)
                   throws java.io.IOException,
                          java.io.EOFException
Reads a short value from a java.io.InputStream strm, ensuring that blocking occurs until the value has been read.

Parameters:
strm - the InputStream from which the short value will be read.
byteOrder - the ByteOrder of the data in the InputStream.
Returns:
a short value read from the InputStream.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

Short

public static short Short(java.io.RandomAccessFile f,
                          java.nio.ByteOrder byteOrder)
                   throws java.io.IOException,
                          java.io.EOFException
Reads a short value from a java.io.RandomAccessFile 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:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

UShort

public static int UShort(java.io.InputStream strm,
                         java.nio.ByteOrder byteOrder)
                  throws java.io.EOFException,
                         java.io.IOException
Reads an unsigned short value from a java.io.InputStream strm, ensuring that blocking occurs until the value has been read.

Parameters:
strm - the InputStream from which the unsigned short value will be read.
byteOrder - the ByteOrder of the data in the InputStream.
Returns:
a unsigned short value read from the InputStream, as an int.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

UShort

public static int UShort(java.io.RandomAccessFile f,
                         java.nio.ByteOrder byteOrder)
                  throws java.io.IOException,
                         java.io.EOFException
Reads an unsigned short value from a java.io.RandomAccessFile 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:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an 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

public static int Integer(java.io.InputStream strm,
                          java.nio.ByteOrder byteOrder)
                   throws java.io.EOFException,
                          java.io.IOException
Reads an integer value from a java.io.InputStream strm, ensuring that blocking occurs until the value has been read.

Parameters:
strm - the InputStream from which the int value will be read.
byteOrder - the ByteOrder of the data in the InputStream.
Returns:
an int value read from the InputStream.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

Integer

public static int Integer(java.io.RandomAccessFile f,
                          java.nio.ByteOrder byteOrder)
                   throws java.io.EOFException,
                          java.io.IOException
Reads an integer value from a java.io.RandomAccessFile 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:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an 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

public static long UInteger(java.io.InputStream strm,
                            java.nio.ByteOrder byteOrder)
                     throws java.io.EOFException,
                            java.io.IOException
Reads an unsigned integer value from a java.io.RandomAccessFile f, ensuring that blocking occurs until the value has been read.

Parameters:
strm - the InputStream 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:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

UInteger

public static long UInteger(java.io.RandomAccessFile f,
                            java.nio.ByteOrder byteOrder)
                     throws java.io.EOFException,
                            java.io.IOException
Reads an unsigned integer value from a java.io.RandomAccessFile 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:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

Long

public static long Long(java.io.InputStream strm,
                        java.nio.ByteOrder byteOrder)
                 throws java.io.EOFException,
                        java.io.IOException
Reads a long value from a java.io.InputStream strm, ensuring that blocking occurs until the value has been read.

Parameters:
strm - the InputStream from which the long value will be read.
byteOrder - the ByteOrder of the data in the InputStream.
Returns:
a long value read from the InputStream.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

Long

public static long Long(java.io.RandomAccessFile f,
                        java.nio.ByteOrder byteOrder)
                 throws java.io.EOFException,
                        java.io.IOException
Reads a long value from a java.io.RandomAccessFile 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:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

Float

public static float Float(java.io.InputStream strm,
                          java.nio.ByteOrder byteOrder)
                   throws java.io.EOFException,
                          java.io.IOException
Reads a float value from a java.io.InputStream strm, ensuring that blocking occurs until the value has been read.

Parameters:
strm - the InputStream from which the float value will be read.
byteOrder - the ByteOrder of the data in the InputStream.
Returns:
a float value read from the InputStream.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

Float

public static float Float(java.io.RandomAccessFile f,
                          java.nio.ByteOrder byteOrder)
                   throws java.io.EOFException,
                          java.io.IOException
Reads a float value from a java.io.RandomAccessFile 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:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

Double

public static double Double(java.io.InputStream strm,
                            java.nio.ByteOrder byteOrder)
                     throws java.io.EOFException,
                            java.io.IOException
Reads a double value from a java.io.InputStream strm, ensuring that blocking occurs until the value has been read.

Parameters:
strm - the InputStream from which the double value will be read.
byteOrder - the ByteOrder of the data in the InputStream.
Returns:
a double value read from the InputStream.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

Double

public static double Double(java.io.RandomAccessFile f,
                            java.nio.ByteOrder byteOrder)
                     throws java.io.EOFException,
                            java.io.IOException
Reads a double value from a java.io.RandomAccessFile 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:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

String

public static java.lang.String String(java.io.InputStream strm,
                                      int nBytes)
                               throws java.io.EOFException,
                                      java.io.IOException
Reads a String from a java.io.InputStream 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 - the InputStream from which the String will be read.
nBytes - the length of the String, in bytes.
Returns:
a String value read from the InputStream.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

String

public static java.lang.String String(java.io.InputStream strm,
                                      int nBytes,
                                      java.nio.charset.Charset charset)
                               throws java.io.EOFException,
                                      java.io.IOException
Reads a String from a java.io.InputStream strm, by decoding the bytes read using the specified charset and ensuring that blocking occurs until the String has been read.

Parameters:
strm - the InputStream 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:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

String

public static java.lang.String String(java.io.RandomAccessFile f,
                                      int nBytes)
                               throws java.io.EOFException,
                                      java.io.IOException
Reads a String from a java.io.RandomAccessFile 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:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

ByteArray

public static byte[] ByteArray(java.io.InputStream strm,
                               int nBytes)
                        throws java.io.EOFException,
                               java.io.IOException
Reads an array of bytes from a java.io.InputStream strm ensuring that blocking occurs until all values have been read.

Parameters:
strm - the InputStream from which the bytes will be read.
nBytes - the number of bytes to read.
Returns:
an array of bytes read from the InputStream.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

ByteArray

public static byte[] ByteArray(java.io.RandomAccessFile f,
                               int nBytes)
                        throws java.io.EOFException,
                               java.io.IOException
Reads an array of bytes from a java.io.RandomAccessFile 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:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

BitSet

public static long BitSet(java.io.InputStream strm,
                          BitSet bitSet)
                   throws java.io.IOException
Reads a com.xinapse.util.BitSet from a java.io.InputStream strm ensuring that blocking occurs until all values have been read.

Parameters:
strm - the InputStream from which the boolean (binary) values will be read.
bitSet - the com.xinapse.util.BitSet that will be filled by this method. The number of values to be read is specified by the length of bitSet.
Returns:
the number of bytes read (rounded up to the next byte if a whole number of bytes is not read).
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

BitSet

public static long BitSet(java.io.DataInputStream strm,
                          BitSet bitSet)
                   throws java.io.IOException
Reads a com.xinapse.util.BitSet from a DataInputStream 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 - the com.xinapse.util.BitSet that will be filled by this method. The number of values to be read is specified by the length of bitSet.
Returns:
the number of bytes read (rounded up to the next byte if a whole number of bytes is not read).
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

BitSet

public static long BitSet(java.io.RandomAccessFile f,
                          BitSet bitSet,
                          int bitOffset)
                   throws java.io.IOException
Reads a com.xinapse.util.BitSet from a java.io.RandomAccessFile 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 - the com.xinapse.util.BitSet that will be filled by this method. The number of values to be read is specified by the length of bitSet.
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:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

ShortArray

public static short[] ShortArray(java.io.InputStream strm,
                                 java.nio.ByteOrder byteOrder,
                                 int nShorts)
                          throws java.io.EOFException,
                                 java.io.IOException
Reads an array of short values from a java.io.InputStream strm ensuring that blocking occurs until all values have been read.

Parameters:
strm - the InputStream from which the short values will be read.
byteOrder - the ByteOrder of the data in the InputStream.
nShorts - the number of short values to read.
Returns:
an array of short values read from the InputStream.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

ShortArray

public static short[] ShortArray(java.io.DataInputStream strm,
                                 java.nio.ByteOrder byteOrder,
                                 short[] sArray)
                          throws java.io.IOException,
                                 java.io.EOFException
Reads an array of short values from a DataInputStream 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 the InputStream.
sArray - the array into which the short values read will be stored.
Returns:
the supplied array.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

ShortArray

public static short[] ShortArray(java.io.RandomAccessFile f,
                                 java.nio.ByteOrder byteOrder,
                                 short[] sArray)
                          throws java.io.IOException,
                                 java.io.EOFException
Reads an array of short values from a java.io.RandomAccessFile 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 the InputStream.
sArray - the array into which the short values read will be stored.
Returns:
the supplied array.
Throws:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

ShortArray

public static short[] ShortArray(java.io.RandomAccessFile f,
                                 java.nio.ByteOrder byteOrder,
                                 short[] sArray,
                                 int off,
                                 int len)
                          throws java.io.IOException,
                                 java.io.EOFException
Reads an array of short values from a java.io.RandomAccessFile 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 the InputStream.
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:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

IntArray

public static int[] IntArray(java.io.InputStream strm,
                             java.nio.ByteOrder byteOrder,
                             int nInts)
                      throws java.io.EOFException,
                             java.io.IOException
Reads an array of int values from a java.io.InputStream strm ensuring that blocking occurs until all values have been read.

Parameters:
strm - the InputStream from which the int values will be read.
byteOrder - the ByteOrder of the data in the InputStream.
nInts - the number of int values to read.
Returns:
an array of int values read from the InputStream.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

IntArray

public static int[] IntArray(java.io.DataInputStream strm,
                             java.nio.ByteOrder byteOrder,
                             int[] iArray)
                      throws java.io.IOException
Reads an array of int values from a DataInputStream 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 the InputStream.
iArray - the array into which the int values read will be stored.
Returns:
the supplied array.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

IntArray

public static int[] IntArray(java.io.RandomAccessFile f,
                             java.nio.ByteOrder byteOrder,
                             int[] iArray)
                      throws java.io.IOException
Reads an array of int values from a java.io.RandomAccessFile 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 the InputStream.
iArray - the array into which the int values read will be stored.
Returns:
the supplied array.
Throws:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

IntArray

public static int[] IntArray(java.io.RandomAccessFile f,
                             java.nio.ByteOrder byteOrder,
                             int[] iArray,
                             int off,
                             int len)
                      throws java.io.IOException
Reads an array of int values from a java.io.RandomAccessFile 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 the InputStream.
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:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

LongArray

public static long[] LongArray(java.io.InputStream strm,
                               java.nio.ByteOrder byteOrder,
                               int nLongs)
                        throws java.io.EOFException,
                               java.io.IOException
Reads an array of long values from a java.io.InputStream strm ensuring that blocking occurs until all values have been read.

Parameters:
strm - the InputStream from which the int values will be read.
byteOrder - the ByteOrder of the data in the InputStream.
nLongs - the number of long values to read.
Returns:
an array of long values read from the InputStream.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

LongArray

public static long[] LongArray(java.io.DataInputStream strm,
                               java.nio.ByteOrder byteOrder,
                               long[] lArray)
                        throws java.io.IOException
Reads an array of long values from a DataInputStream 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 the InputStream.
lArray - the array into which the long values read will be stored.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

LongArray

public static long[] LongArray(java.io.RandomAccessFile f,
                               java.nio.ByteOrder byteOrder,
                               long[] lArray)
                        throws java.io.IOException
Reads an array of long values from a java.io.RandomAccessFile f ensuring that blocking occurs until all values have been read.

Parameters:
f - the RandomAccessFile from which the long values will be read.
byteOrder - the java.nio.ByteOrder of the data in the InputStream.
lArray - the array into which the long values read will be stored.
Returns:
the supplied array.
Throws:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

LongArray

public static long[] LongArray(java.io.RandomAccessFile f,
                               java.nio.ByteOrder byteOrder,
                               long[] lArray,
                               int off,
                               int len)
                        throws java.io.IOException
Reads an array of long values from a java.io.RandomAccessFile f, ensuring that blocking occurs until all values have been read.

Parameters:
f - the RandomAccessFile from which the long values will be read.
byteOrder - the java.nio.ByteOrder of the data in the InputStream.
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:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

FloatArray

public static float[] FloatArray(java.io.InputStream strm,
                                 java.nio.ByteOrder byteOrder,
                                 int nFloats)
                          throws java.io.EOFException,
                                 java.io.IOException
Reads an array of float values from a java.io.InputStream strm ensuring that blocking occurs until all values have been read.

Parameters:
strm - the InputStream from which the float values will be read.
byteOrder - the ByteOrder of the data in the InputStream.
nFloats - the number of float values to read.
Returns:
an array of float values read from the InputStream.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

FloatArray

public static float[] FloatArray(java.io.DataInputStream strm,
                                 java.nio.ByteOrder byteOrder,
                                 float[] fArray)
                          throws java.io.IOException
Reads an array of float values from a DataInputStream 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 the InputStream.
fArray - the array into which the float values read will be stored.
Returns:
the supplied array.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

FloatArray

public static float[] FloatArray(java.io.RandomAccessFile f,
                                 java.nio.ByteOrder byteOrder,
                                 float[] fArray)
                          throws java.io.IOException
Reads an array of float values from a java.io.RandomAccessFile 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 the InputStream.
fArray - the array into which the float values read will be stored.
Returns:
the supplied array.
Throws:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

FloatArray

public static float[] FloatArray(java.io.RandomAccessFile f,
                                 java.nio.ByteOrder byteOrder,
                                 float[] fArray,
                                 int off,
                                 int len)
                          throws java.io.IOException
Reads an array of float values from a java.io.RandomAccessFile 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 the InputStream.
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:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

DoubleArray

public static double[] DoubleArray(java.io.InputStream strm,
                                   java.nio.ByteOrder byteOrder,
                                   int nDoubles)
                            throws java.io.EOFException,
                                   java.io.IOException
Reads an array of double values from a java.io.InputStream strm ensuring that blocking occurs until all values have been read.

Parameters:
strm - the InputStream from which the double values will be read.
byteOrder - the ByteOrder of the data in the InputStream.
nDoubles - the number of double values to read.
Returns:
an array of double values read from the InputStream.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

DoubleArray

public static double[] DoubleArray(java.io.InputStream strm,
                                   java.nio.ByteOrder byteOrder,
                                   double[] dArray)
                            throws java.io.IOException
Reads an array of double values from a DataInputStream 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 the InputStream.
dArray - the array into which the double values read will be stored.
Throws:
java.io.EOFException - if the end of the stream is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

DoubleArray

public static double[] DoubleArray(java.io.RandomAccessFile f,
                                   java.nio.ByteOrder byteOrder,
                                   double[] dArray)
                            throws java.io.IOException
Reads an array of double values from a java.io.RandomAccessFile 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 the InputStream.
dArray - the array into which the double values read will be stored.
Returns:
the supplied array.
Throws:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.

DoubleArray

public static double[] DoubleArray(java.io.RandomAccessFile f,
                                   java.nio.ByteOrder byteOrder,
                                   double[] dArray,
                                   int off,
                                   int len)
                            throws java.io.IOException
Reads an array of double values from a java.io.RandomAccessFile 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 the InputStream.
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:
java.io.EOFException - if the end of the file is reached before reading is completed.
java.io.IOException - if reading an error occurs during the read.


Copyright 2006-2011 Xinapse Systems Limited. All Rights Reserved.