com.xinapse.io
Class Output

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

public abstract class Output
extends java.lang.Object

Abstract class providing methods to write primitve data values to output files and streams. The byte order of the data output file/stream can be specified for multi-byte primitive values.


Method Summary
static long BooleanArray(boolean[] bArray, java.io.OutputStream strm)
          Writes an array of boolean values as individual bits to an OutputStream strm.
static long BooleanArray(boolean[] bArray, java.io.RandomAccessFile f, int bitOffset)
          Writes an array of boolean values as individual bits to ajava.io.RandomAccessFile f.
static long Byte(byte b, java.io.OutputStream strm)
          Write a single byte value to an OutputStream strm.
static long Byte(byte b, java.io.RandomAccessFile f)
          Write a single byte value to a RandomAccessFile f.
static long ByteArray(byte[] b, java.io.OutputStream strm)
          Write an array of byte values to an OutputStream strm.
static long Double(double d, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write a single double to an OutputStream strm.
static long Double(java.lang.Double d, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write a single Double to an OutputStream strm as a double primitive.
static long Double(double d, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write a single double to ajava.io.RandomAccessFile f.
static long Double(java.lang.Double d, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write a single Double to ajava.io.RandomAccessFile f as a double primitive.
static long DoubleArray(double[] dArray, int off, int len, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write an array of double values to ajava.io.RandomAccessFile f.
static long DoubleArray(double[] dArray, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write an array of double values to an OutputStream strm.
static long DoubleArray(double[] dArray, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write an array of double values to ajava.io.RandomAccessFile f.
static long Float(float f, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write a single float to an OutputStream strm.
static long Float(java.lang.Float f, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write a single Float to an OutputStream strm as a float primitive.
static long Float(float flt, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write a single float to ajava.io.RandomAccessFile f.
static long Float(java.lang.Float flt, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write a single Float to ajava.io.RandomAccessFile f as a float primitive.
static long FloatArray(float[] fArray, int off, int len, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write an array of float values to ajava.io.RandomAccessFile f.
static long FloatArray(float[] fArray, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write an array of float values to an OutputStream strm.
static long FloatArray(float[] fArray, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write an array of float values to ajava.io.RandomAccessFile f.
static long IntArray(int[] iArray, int off, int len, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write an array of int values to ajava.io.RandomAccessFile f.
static long IntArray(int[] iArray, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write an array of int values to an OutputStream strm.
static long IntArray(int[] iArray, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write an array of int values to ajava.io.RandomAccessFile f.
static long Integer(java.lang.Integer i, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write a single Integer to an OutputStream strm as a primitive int value.
static long Integer(java.lang.Integer i, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write a single Integer to ajava.io.RandomAccessFile f as a primitive int value.
static long Integer(int i, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write a single int to an OutputStream strm.
static long Integer(int i, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write a single int to ajava.io.RandomAccessFile f.
static long Long(long l, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write a single long to an OutputStream strm.
static long Long(long l, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write a single long to an java.io.RandomAccessFile f.
static long LongArray(long[] lArray, int off, int len, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write an array of long values to ajava.io.RandomAccessFile f.
static long LongArray(long[] lArray, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write an array of long values to an OutputStream strm.
static long LongArray(long[] lArray, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write an array of long values to ajava.io.RandomAccessFile f.
static long Short(short s, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write a single short to an OutputStream strm.
static long Short(java.lang.Short s, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write a single Short to an OutputStream strm as a primitive short value.
static long Short(short s, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write a single short to ajava.io.RandomAccessFile f.
static long Short(java.lang.Short s, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write a single Short to a java.io.RandomAccessFile f as a primitive short value.
static long ShortArray(short[] sArray, int off, int len, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write an array of short values to ajava.io.RandomAccessFile f.
static long ShortArray(short[] sArray, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write an array of short values to an OutputStream strm.
static long ShortArray(short[] sArray, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write an array of short values to ajava.io.RandomAccessFile f.
static long String(java.lang.String s, java.io.OutputStream strm)
          Write a String to an OutputStream strm.
static long String(java.lang.String s, java.io.OutputStream strm, java.nio.charset.Charset charset)
          Write a String to an OutputStream strm.
static long UInteger(long l, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write a single long to an OutputStream strm as an unsigned int value.
static long UInteger(java.lang.Long l, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write a single Long to an OutputStream strm as an unsigned int value.
static long UInteger(long l, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write a single Long to aRandomAccessFile f as an unsigned int value.
static long UInteger(java.lang.Long l, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write a single Long to an OutputStream strm as an unsigned int value.
static long UShort(java.lang.Integer i, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write a single Integer to an OutputStream strm as an unsigned short value.
static long UShort(java.lang.Integer i, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write a single Integer to a RandomAccessFile f as an unsigned short value.
static long UShort(int i, java.io.OutputStream strm, java.nio.ByteOrder byteOrder)
          Write a single int to an OutputStream strm as an unsigned short value.
static long UShort(int i, java.io.RandomAccessFile f, java.nio.ByteOrder byteOrder)
          Write a single int to a RandomAccessFile f as an unsigned short value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

Byte

public static long Byte(byte b,
                        java.io.OutputStream strm)
                 throws java.io.IOException
Write a single byte value to an OutputStream strm.

Parameters:
b - the byte to write.
strm - the OutputStream to which the byte will be written. If strm is null, no data are written.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Byte

public static long Byte(byte b,
                        java.io.RandomAccessFile f)
                 throws java.io.IOException
Write a single byte value to a RandomAccessFile f.

Parameters:
b - the byte to write.
f - the RandomAccessFile to which the byte will be written. If f is null, no data are written.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Short

public static long Short(java.lang.Short s,
                         java.io.OutputStream strm,
                         java.nio.ByteOrder byteOrder)
                  throws java.io.IOException
Write a single Short to an OutputStream strm as a primitive short value.

Parameters:
s - the Short to write.
strm - the OutputStream to which the Short's short value will be written. If strm is null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Short

public static long Short(short s,
                         java.io.OutputStream strm,
                         java.nio.ByteOrder byteOrder)
                  throws java.io.IOException
Write a single short to an OutputStream strm.

Parameters:
s - the short to write.
strm - theOutputStream to which the short value will be written. If strm is null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if fhad not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Short

public static long Short(java.lang.Short s,
                         java.io.RandomAccessFile f,
                         java.nio.ByteOrder byteOrder)
                  throws java.io.IOException
Write a single Short to a java.io.RandomAccessFile f as a primitive short value.

Parameters:
s - the Short to write.
f - the java.io.RandomAccessFile to which the Short's short value will be written. If fis null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the file.
Returns:
the number of bytes written, or that would have been written if fhad not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Short

public static long Short(short s,
                         java.io.RandomAccessFile f,
                         java.nio.ByteOrder byteOrder)
                  throws java.io.IOException
Write a single short to ajava.io.RandomAccessFile f.

Parameters:
s - the short to write.
f - the java.io.RandomAccessFile to which the short value will be written. If fis null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the file.
Returns:
the number of bytes written, or that would have been written if fhad not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

UShort

public static long UShort(java.lang.Integer i,
                          java.io.OutputStream strm,
                          java.nio.ByteOrder byteOrder)
                   throws java.io.IOException
Write a single Integer to an OutputStream strm as an unsigned short value. If the Integer's size or sign mean that it cannot be written as an unsigned short, then the incorrect value will be written.

Parameters:
i - the Integer to write.
strm - the OutputStream to which the Integer's value will be written as an unsigned short. If strm is null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

UShort

public static long UShort(int i,
                          java.io.OutputStream strm,
                          java.nio.ByteOrder byteOrder)
                   throws java.io.IOException
Write a single int to an OutputStream strm as an unsigned short value. If the int's size or sign mean that it cannot be written as an unsigned short, then the incorrect value will be written.

Parameters:
i - the int to write.
strm - the OutputStream to which the int's value will be written as an unsigned short. If strm is null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

UShort

public static long UShort(java.lang.Integer i,
                          java.io.RandomAccessFile f,
                          java.nio.ByteOrder byteOrder)
                   throws java.io.IOException
Write a single Integer to a RandomAccessFile f as an unsigned short value. If the Integer's size or sign mean that it cannot be written as an unsigned short, then the incorrect value will be written.

Parameters:
i - the Integer to write.
f - the RandomAccessFile>/tt> to which the Integer's value will be written as an unsigned short. If f is null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

UShort

public static long UShort(int i,
                          java.io.RandomAccessFile f,
                          java.nio.ByteOrder byteOrder)
                   throws java.io.IOException
Write a single int to a RandomAccessFile f as an unsigned short value. If the int's size or sign mean that it cannot be written as an unsigned short, then the incorrect value will be written.

Parameters:
i - the int to write.
f - the RandomAccessFile to which the int's value will be written as an unsigned short. If f is null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Integer

public static long Integer(java.lang.Integer i,
                           java.io.OutputStream strm,
                           java.nio.ByteOrder byteOrder)
                    throws java.io.IOException
Write a single Integer to an OutputStream strm as a primitive int value.

Parameters:
i - the Integer to write.
strm - the OutputStream to which the Integer's value will be written as an int. If strm is null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Integer

public static long Integer(int i,
                           java.io.OutputStream strm,
                           java.nio.ByteOrder byteOrder)
                    throws java.io.IOException
Write a single int to an OutputStream strm.

Parameters:
i - the int to write.
strm - the OutputStream to which the int's value will be written. If strm is null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Integer

public static long Integer(java.lang.Integer i,
                           java.io.RandomAccessFile f,
                           java.nio.ByteOrder byteOrder)
                    throws java.io.IOException
Write a single Integer to ajava.io.RandomAccessFile f as a primitive int value.

Parameters:
i - the Integer to write.
f - the java.io.RandomAccessFile to which the Integer's value will be written as an int. If fis null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Integer

public static long Integer(int i,
                           java.io.RandomAccessFile f,
                           java.nio.ByteOrder byteOrder)
                    throws java.io.IOException
Write a single int to ajava.io.RandomAccessFile f.

Parameters:
i - the int to write.
f - the java.io.RandomAccessFile to which the int's value will be written. If fis null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if fhad not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

UInteger

public static long UInteger(java.lang.Long l,
                            java.io.OutputStream strm,
                            java.nio.ByteOrder byteOrder)
                     throws java.io.IOException
Write a single Long to an OutputStream strm as an unsigned int value. If the Long's size or sign mean that it cannot be written as an unsigned int, then the incorrect value will be written.

Parameters:
l - the Long to write.
strm - the OutputStream to which the Long's value will be written as an unsigned int. If strm is null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

UInteger

public static long UInteger(long l,
                            java.io.OutputStream strm,
                            java.nio.ByteOrder byteOrder)
                     throws java.io.IOException
Write a single long to an OutputStream strm as an unsigned int value. If the long's size or sign mean that it cannot be written as an unsigned int, then the incorrect value will be written.

Parameters:
l - the long to write.
strm - the OutputStream to which the long's value will be written as an unsigned int. If strm is null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

UInteger

public static long UInteger(java.lang.Long l,
                            java.io.RandomAccessFile f,
                            java.nio.ByteOrder byteOrder)
                     throws java.io.IOException
Write a single Long to an OutputStream strm as an unsigned int value. If the long's size or sign mean that it cannot be written as an unsigned short, then the incorrect value will be written.

Parameters:
l - the unsigned integer value (as a Long) to write.
f - the java.io.RandomAccessFile to which the unsigned integer value will be written as an int. If fis null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

UInteger

public static long UInteger(long l,
                            java.io.RandomAccessFile f,
                            java.nio.ByteOrder byteOrder)
                     throws java.io.IOException
Write a single Long to aRandomAccessFile f as an unsigned int value. If the long's size or sign mean that it cannot be written as an unsigned short, then the incorrect value will be written.

Parameters:
l - the unsigned int value (as a long) to write.
f - the java.io.RandomAccessFile to which the unsigned int value will be written. If fis null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if fhad not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Long

public static long Long(long l,
                        java.io.OutputStream strm,
                        java.nio.ByteOrder byteOrder)
                 throws java.io.IOException
Write a single long to an OutputStream strm.

Parameters:
l - the long to write.
strm - the OutputStream to which the long's value will be written. If strm is null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Long

public static long Long(long l,
                        java.io.RandomAccessFile f,
                        java.nio.ByteOrder byteOrder)
                 throws java.io.IOException
Write a single long to an java.io.RandomAccessFile f.

Parameters:
l - the long to write.
f - the java.io.RandomAccessFile to which the long's value will be written. If f is null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Float

public static long Float(java.lang.Float f,
                         java.io.OutputStream strm,
                         java.nio.ByteOrder byteOrder)
                  throws java.io.IOException
Write a single Float to an OutputStream strm as a float primitive.

Parameters:
f - the Float to write.
strm - the OutputStream to which the Float's value will be written. If strm is null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Float

public static long Float(float f,
                         java.io.OutputStream strm,
                         java.nio.ByteOrder byteOrder)
                  throws java.io.IOException
Write a single float to an OutputStream strm.

Parameters:
f - the float value to write.
strm - the OutputStream to which the float's value will be written. If strm is null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Float

public static long Float(java.lang.Float flt,
                         java.io.RandomAccessFile f,
                         java.nio.ByteOrder byteOrder)
                  throws java.io.IOException
Write a single Float to ajava.io.RandomAccessFile f as a float primitive.

Parameters:
flt - the Float to write.
f - the java.io.RandomAccessFile to which the Float's value will be written. If f is null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Float

public static long Float(float flt,
                         java.io.RandomAccessFile f,
                         java.nio.ByteOrder byteOrder)
                  throws java.io.IOException
Write a single float to ajava.io.RandomAccessFile f.

Parameters:
flt - the float to write.
f - the java.io.RandomAccessFile to which the float's value will be written. If f is null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if fhad not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Double

public static long Double(java.lang.Double d,
                          java.io.OutputStream strm,
                          java.nio.ByteOrder byteOrder)
                   throws java.io.IOException
Write a single Double to an OutputStream strm as a double primitive.

Parameters:
d - the Double to write.
strm - the OutputStream to which the Double's value will be written.
byteOrder - the java.nio.ByteOrder of the data in the stream. If fis null, no data are written.
Returns:
the number of bytes written, or that would have been written if fhad not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Double

public static long Double(double d,
                          java.io.OutputStream strm,
                          java.nio.ByteOrder byteOrder)
                   throws java.io.IOException
Write a single double to an OutputStream strm.

Parameters:
d - the double to write.
strm - the OutputStream to which the double's value will be written. If fis null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if fhad not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Double

public static long Double(java.lang.Double d,
                          java.io.RandomAccessFile f,
                          java.nio.ByteOrder byteOrder)
                   throws java.io.IOException
Write a single Double to ajava.io.RandomAccessFile f as a double primitive.

Parameters:
d - the Double to write.
f - the java.io.RandomAccessFile to which the Double's value will be written.
byteOrder - the java.nio.ByteOrder of the data in the stream. If fis null, no data are written.
Returns:
the number of bytes written, or that would have been written if fhad not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

Double

public static long Double(double d,
                          java.io.RandomAccessFile f,
                          java.nio.ByteOrder byteOrder)
                   throws java.io.IOException
Write a single double to ajava.io.RandomAccessFile f.

Parameters:
d - the double to write.
f - the java.io.RandomAccessFile to which the double's value will be written. If fis null, no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if fhad not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

String

public static long String(java.lang.String s,
                          java.io.OutputStream strm)
                   throws java.io.IOException
Write a String to an OutputStream strm. The String is encoded using UTF-8 Character Encoding.

Parameters:
s - the String to write.
strm - the OutputStream to which the String will be written.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

String

public static long String(java.lang.String s,
                          java.io.OutputStream strm,
                          java.nio.charset.Charset charset)
                   throws java.io.IOException
Write a String to an OutputStream strm. The String is encoded using the specified Charset's Character Encoding.

Parameters:
s - the String to write.
strm - the OutputStream to which the String will be written.
charset - the charset that will be used to encode the String.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

ByteArray

public static long ByteArray(byte[] b,
                             java.io.OutputStream strm)
                      throws java.io.IOException
Write an array of byte values to an OutputStream strm.

Parameters:
b - the array of bytes to write.
strm - the OutputStream to which the bytes will be written. If strm is null, no data are written.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

BooleanArray

public static long BooleanArray(boolean[] bArray,
                                java.io.OutputStream strm)
                         throws java.io.IOException
Writes an array of boolean values as individual bits to an OutputStream strm.

If the number of boolean values to be written is not a multiple of 8, then a full byte is written at the end, with any unused bits written as 0's.

Parameters:
bArray - the array of boolean values to write.
strm - the OutputStream to which the boolean values will be written.
Returns:
the number of bytes written, or that would have been written if strm were non-null.
Throws:
java.io.IOException - if writing can't be completed.

BooleanArray

public static long BooleanArray(boolean[] bArray,
                                java.io.RandomAccessFile f,
                                int bitOffset)
                         throws java.io.IOException
Writes an array of boolean values as individual bits to ajava.io.RandomAccessFile f.

If the number of boolean values to be written is not a multiple of 8, then a full byte is written at the end, with any unused bits written as 0's.

Parameters:
bArray - the array of boolean values to write.
f - the java.io.RandomAccessFile to which the boolean values will be written.
bitOffset - an offset (in bits) from the current location in the RandomAccessFile to the point where writing bits should start.
Returns:
the number of bytes written, or that would have been written if f had been non-null.
Throws:
java.io.IOException - if writing can't be completed.

ShortArray

public static long ShortArray(short[] sArray,
                              java.io.OutputStream strm,
                              java.nio.ByteOrder byteOrder)
                       throws java.io.IOException
Write an array of short values to an OutputStream strm.

Parameters:
sArray - the array of shorts to write.
strm - the OutputStream to which the shorts will be written. If strm is null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

ShortArray

public static long ShortArray(short[] sArray,
                              java.io.RandomAccessFile f,
                              java.nio.ByteOrder byteOrder)
                       throws java.io.IOException
Write an array of short values to ajava.io.RandomAccessFile f.

Parameters:
sArray - the array of shorts to write.
f - the java.io.RandomAccessFile to which the shorts will be written. If f is null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

ShortArray

public static long ShortArray(short[] sArray,
                              int off,
                              int len,
                              java.io.RandomAccessFile f,
                              java.nio.ByteOrder byteOrder)
                       throws java.io.IOException
Write an array of short values to ajava.io.RandomAccessFile f.

Parameters:
sArray - the array of shorts to write.
off - the offset (number of shorts) into the sArray at which writing begins.
len - the number of shorts to write.
f - the java.io.RandomAccessFile to which the shorts will be written. If f is null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

IntArray

public static long IntArray(int[] iArray,
                            java.io.OutputStream strm,
                            java.nio.ByteOrder byteOrder)
                     throws java.io.IOException
Write an array of int values to an OutputStream strm.

Parameters:
iArray - the array of ints to write.
strm - the OutputStream to which the ints will be written. If strm is null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

IntArray

public static long IntArray(int[] iArray,
                            java.io.RandomAccessFile f,
                            java.nio.ByteOrder byteOrder)
                     throws java.io.IOException
Write an array of int values to ajava.io.RandomAccessFile f.

Parameters:
iArray - the array of ints to write.
f - the java.io.RandomAccessFile to which the ints will be written. If strm is null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

IntArray

public static long IntArray(int[] iArray,
                            int off,
                            int len,
                            java.io.RandomAccessFile f,
                            java.nio.ByteOrder byteOrder)
                     throws java.io.IOException
Write an array of int values to ajava.io.RandomAccessFile f.

Parameters:
iArray - the array of ints to write.
off - the offset (number of ints) into the iArray at which writing begins.
len - the number of ints to write.
f - the java.io.RandomAccessFile to which the ints will be written. If strm is null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

LongArray

public static long LongArray(long[] lArray,
                             java.io.OutputStream strm,
                             java.nio.ByteOrder byteOrder)
                      throws java.io.IOException
Write an array of long values to an OutputStream strm.

Parameters:
lArray - the array of longs to write.
strm - the OutputStream to which the longs will be written. If strm is null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

LongArray

public static long LongArray(long[] lArray,
                             java.io.RandomAccessFile f,
                             java.nio.ByteOrder byteOrder)
                      throws java.io.IOException
Write an array of long values to ajava.io.RandomAccessFile f.

Parameters:
lArray - the array of longs to write.
f - the java.io.RandomAccessFile to which the longs will be written. If strm is null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

LongArray

public static long LongArray(long[] lArray,
                             int off,
                             int len,
                             java.io.RandomAccessFile f,
                             java.nio.ByteOrder byteOrder)
                      throws java.io.IOException
Write an array of long values to ajava.io.RandomAccessFile f.

Parameters:
lArray - the array of longs to write.
off - the offset (number of longs) into the lArray at which writing begins.
len - the number of longs to write.
f - the java.io.RandomAccessFile to which the longs will be written. If strm is null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

FloatArray

public static long FloatArray(float[] fArray,
                              java.io.OutputStream strm,
                              java.nio.ByteOrder byteOrder)
                       throws java.io.IOException
Write an array of float values to an OutputStream strm.

Parameters:
fArray - the array of floats to write.
strm - the OutputStream to which the floats will be written. If strm is null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

FloatArray

public static long FloatArray(float[] fArray,
                              java.io.RandomAccessFile f,
                              java.nio.ByteOrder byteOrder)
                       throws java.io.IOException
Write an array of float values to ajava.io.RandomAccessFile f.

Parameters:
fArray - the array of floats to write.
f - the java.io.RandomAccessFile to which the floats will be written. If strm is null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

FloatArray

public static long FloatArray(float[] fArray,
                              int off,
                              int len,
                              java.io.RandomAccessFile f,
                              java.nio.ByteOrder byteOrder)
                       throws java.io.IOException
Write an array of float values to ajava.io.RandomAccessFile f.

Parameters:
fArray - the array of floats to write.
off - the offset (number of floats) into the fArray at which writing begins.
len - the number of floats to write.
f - the java.io.RandomAccessFile to which the floats will be written. If strm is null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

DoubleArray

public static long DoubleArray(double[] dArray,
                               java.io.OutputStream strm,
                               java.nio.ByteOrder byteOrder)
                        throws java.io.IOException
Write an array of double values to an OutputStream strm.

Parameters:
dArray - the array of doubles to write.
strm - the OutputStream to which the doubles will be written. If strm is null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if strm had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

DoubleArray

public static long DoubleArray(double[] dArray,
                               java.io.RandomAccessFile f,
                               java.nio.ByteOrder byteOrder)
                        throws java.io.IOException
Write an array of double values to ajava.io.RandomAccessFile f.

Parameters:
dArray - the array of doubles to write.
f - the java.io.RandomAccessFile to which the doubles will be written. If strm is null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.

DoubleArray

public static long DoubleArray(double[] dArray,
                               int off,
                               int len,
                               java.io.RandomAccessFile f,
                               java.nio.ByteOrder byteOrder)
                        throws java.io.IOException
Write an array of double values to ajava.io.RandomAccessFile f.

Parameters:
dArray - the array of doubles to write.
off - the offset (number of doubles) into the dArray at which writing begins.
len - the number of doubles to write.
f - the java.io.RandomAccessFile to which the doubles will be written. If strm is null no data are written.
byteOrder - the java.nio.ByteOrder of the data in the stream.
Returns:
the number of bytes written, or that would have been written if f had not been null.
Throws:
java.io.IOException - if an error occurs while performing the write.


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