Package com.xinapse.io
Class Output
java.lang.Object
com.xinapse.io.Output
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
Modifier and TypeMethodDescriptionstatic long
BitSet
(BitSet bitSet, OutputStream strm) static long
BitSet
(BitSet bitSet, RandomAccessFile f, int bitOffset) static long
Byte
(byte b, OutputStream strm) Write a single byte value to anOutputStream
strm
.static long
Byte
(byte b, RandomAccessFile f) Write a single byte value to aRandomAccessFile
f
.static long
ByteArray
(byte[] b, OutputStream strm) Write an array of byte values to aOutputStream
strm
.static long
Double
(double d, OutputStream strm, ByteOrder byteOrder) Write a single double to aOutputStream
strm
.static long
Double
(double d, RandomAccessFile f, ByteOrder byteOrder) Write a single double to aRandomAccessFile
f
.static long
Double
(Double d, OutputStream strm, ByteOrder byteOrder) Write a single Double to aOutputStream
strm
as a double primitive.static long
Double
(Double d, RandomAccessFile f, ByteOrder byteOrder) Write a single Double to aRandomAccessFile
f
as a double primitive.static long
DoubleArray
(double[] dArray, int off, int len, RandomAccessFile f, ByteOrder byteOrder) Write an array of double values to aRandomAccessFile
f
.static long
DoubleArray
(double[] dArray, OutputStream strm, ByteOrder byteOrder) Write an array of double values to aOutputStream
strm
.static long
DoubleArray
(double[] dArray, RandomAccessFile f, ByteOrder byteOrder) Write an array of double values to aRandomAccessFile
f
.static long
Float
(float f, OutputStream strm, ByteOrder byteOrder) Write a single float to aOutputStream
strm
.static long
Float
(float flt, RandomAccessFile f, ByteOrder byteOrder) Write a single float to aRandomAccessFile
f
.static long
Float
(Float f, OutputStream strm, ByteOrder byteOrder) Write a single Float to aOutputStream
strm
as a float primitive.static long
Float
(Float flt, RandomAccessFile f, ByteOrder byteOrder) Write a single Float to aRandomAccessFile
f
as a float primitive.static long
FloatArray
(float[] fArray, int off, int len, RandomAccessFile f, ByteOrder byteOrder) Write an array of float values to aRandomAccessFile
f
.static long
FloatArray
(float[] fArray, OutputStream strm, ByteOrder byteOrder) Write an array of float values to aOutputStream
strm
.static long
FloatArray
(float[] fArray, RandomAccessFile f, ByteOrder byteOrder) Write an array of float values to aRandomAccessFile
f
.static long
IntArray
(int[] iArray, int off, int len, RandomAccessFile f, ByteOrder byteOrder) Write an array of int values to aRandomAccessFile
f
.static long
IntArray
(int[] iArray, OutputStream strm, ByteOrder byteOrder) Write an array of int values to aOutputStream
strm
.static long
IntArray
(int[] iArray, RandomAccessFile f, ByteOrder byteOrder) Write an array of int values to aRandomAccessFile
f
.static long
Integer
(int i, OutputStream strm, ByteOrder byteOrder) Write a single int to aOutputStream
strm
.static long
Integer
(int i, RandomAccessFile f, ByteOrder byteOrder) Write a single int to aRandomAccessFile
f
.static long
Integer
(Integer i, OutputStream strm, ByteOrder byteOrder) Write a single Integer to aOutputStream
strm
as a primitive int value.static long
Integer
(Integer i, RandomAccessFile f, ByteOrder byteOrder) Write a single Integer to aRandomAccessFile
f
as a primitive int value.static long
Long
(long l, OutputStream strm, ByteOrder byteOrder) Write a single long to aOutputStream
strm
.static long
Long
(long l, RandomAccessFile f, ByteOrder byteOrder) Write a single long to aRandomAccessFile
f
.static long
LongArray
(long[] lArray, int off, int len, RandomAccessFile f, ByteOrder byteOrder) Write an array of long values to aRandomAccessFile
f
.static long
LongArray
(long[] lArray, OutputStream strm, ByteOrder byteOrder) Write an array of long values to aOutputStream
strm
.static long
LongArray
(long[] lArray, RandomAccessFile f, ByteOrder byteOrder) Write an array of long values to aRandomAccessFile
f
.static long
Short
(short s, OutputStream strm, ByteOrder byteOrder) Write a single short to aOutputStream
strm
.static long
Short
(short s, RandomAccessFile f, ByteOrder byteOrder) Write a single short to aRandomAccessFile
f
.static long
Short
(Short s, OutputStream strm, ByteOrder byteOrder) Write a single Short to aOutputStream
strm
as a primitive short value.static long
Short
(Short s, RandomAccessFile f, ByteOrder byteOrder) Write a single Short to aRandomAccessFile
f
as a primitive short value.static long
ShortArray
(short[] sArray, int off, int len, RandomAccessFile f, ByteOrder byteOrder) Write an array of short values to aRandomAccessFile
f
.static long
ShortArray
(short[] sArray, OutputStream strm, ByteOrder byteOrder) Write an array of short values to aOutputStream
strm
.static long
ShortArray
(short[] sArray, RandomAccessFile f, ByteOrder byteOrder) Write an array of short values to aRandomAccessFile
f
.static long
String
(String s, OutputStream strm) Write a String to aOutputStream
strm
.static long
String
(String s, OutputStream strm, Charset charset) Write a String to aOutputStream
strm
.static long
UInteger
(long l, OutputStream strm, ByteOrder byteOrder) Write a single long to aOutputStream
strm
as an unsigned int value.static long
UInteger
(long l, RandomAccessFile f, ByteOrder byteOrder) Write a single Long to aRandomAccessFile
f
as an unsigned int value.static long
UInteger
(Long l, OutputStream strm, ByteOrder byteOrder) Write a single Long to aOutputStream
strm
as an unsigned int value.static long
UInteger
(Long l, RandomAccessFile f, ByteOrder byteOrder) Write a single Long to aOutputStream
strm
as an unsigned int value.static long
UShort
(int i, OutputStream strm, ByteOrder byteOrder) Write a single int to aOutputStream
strm
as an unsigned short value.static long
UShort
(int i, RandomAccessFile f, ByteOrder byteOrder) Write a single int to aRandomAccessFile
f
as an unsigned short value.static long
UShort
(Integer i, OutputStream strm, ByteOrder byteOrder) Write a single Integer to aOutputStream
strm
as an unsigned short value.static long
UShort
(Integer i, RandomAccessFile f, ByteOrder byteOrder) Write a single Integer to aRandomAccessFile
f
as an unsigned short value.
-
Method Details
-
Byte
Write a single byte value to anOutputStream
strm
.- Parameters:
b
- the byte to write.strm
- theOutputStream
to which the byte will be written. Ifstrm
isnull
, no data are written.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Byte
Write a single byte value to aRandomAccessFile
f
.- Parameters:
b
- the byte to write.f
- theRandomAccessFile
to which the byte will be written. Iff
isnull
, no data are written.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Short
Write a single Short to aOutputStream
strm
as a primitive short value.- Parameters:
s
- the Short to write.strm
- theOutputStream
to which the Short's short value will be written. Ifstrm
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Short
Write a single short to aOutputStream
strm
.- Parameters:
s
- the short to write.strm
- theOutputStream
to which the short value will be written. Ifstrm
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Short
Write a single Short to aRandomAccessFile
f
as a primitive short value.- Parameters:
s
- the Short to write.f
- theRandomAccessFile
to which the Short's short value will be written. Iff
isnull
no data are written.byteOrder
- theByteOrder
of the data in the file.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Short
Write a single short to aRandomAccessFile
f
.- Parameters:
s
- the short to write.f
- theRandomAccessFile
to which the short value will be written. Iff
isnull
no data are written.byteOrder
- theByteOrder
of the data in the file.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
UShort
Write a single Integer to aOutputStream
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
- theOutputStream
to which the Integer's value will be written as an unsigned short. Ifstrm
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
UShort
Write a single int to aOutputStream
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
- theOutputStream
to which the int's value will be written as an unsigned short. Ifstrm
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
UShort
Write a single Integer to aRandomAccessFile
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
- theRandomAccessFile
to which the Integer's value will be written as an unsigned short. Iff
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
UShort
Write a single int to aRandomAccessFile
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
- theRandomAccessFile
to which the int's value will be written as an unsigned short. Iff
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Integer
Write a single Integer to aOutputStream
strm
as a primitive int value.- Parameters:
i
- the Integer to write.strm
- theOutputStream
to which the Integer's value will be written as an int. Ifstrm
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Integer
Write a single int to aOutputStream
strm
.- Parameters:
i
- the int to write.strm
- theOutputStream
to which the int's value will be written. Ifstrm
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Integer
Write a single Integer to aRandomAccessFile
f
as a primitive int value.- Parameters:
i
- the Integer to write.f
- theRandomAccessFile
to which the Integer's value will be written as an int. Iff
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Integer
Write a single int to aRandomAccessFile
f
.- Parameters:
i
- the int to write.f
- theRandomAccessFile
to which the int's value will be written. Iff
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
UInteger
Write a single Long to aOutputStream
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
- theOutputStream
to which the Long's value will be written as an unsigned int. Ifstrm
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
UInteger
Write a single long to aOutputStream
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
- theOutputStream
to which the long's value will be written as an unsigned int. Ifstrm
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
UInteger
Write a single Long to aOutputStream
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
- theRandomAccessFile
to which the unsigned integer value will be written as an int. Iff
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
UInteger
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
- theRandomAccessFile
to which the unsigned int value will be written. Iff
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Long
Write a single long to aOutputStream
strm
.- Parameters:
l
- the long to write.strm
- theOutputStream
to which the long's value will be written. Ifstrm
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Long
Write a single long to aRandomAccessFile
f
.- Parameters:
l
- the long to write.f
- theRandomAccessFile
to which the long's value will be written. Iff
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Float
Write a single Float to aOutputStream
strm
as a float primitive.- Parameters:
f
- the Float to write.strm
- theOutputStream
to which the Float's value will be written. Ifstrm
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Float
Write a single float to aOutputStream
strm
.- Parameters:
f
- the float value to write.strm
- theOutputStream
to which the float's value will be written. Ifstrm
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Float
Write a single Float to aRandomAccessFile
f
as a float primitive.- Parameters:
flt
- the Float to write.f
- theRandomAccessFile
to which the Float's value will be written. Iff
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Float
Write a single float to aRandomAccessFile
f
.- Parameters:
flt
- the float to write.f
- theRandomAccessFile
to which the float's value will be written. Iff
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Double
Write a single Double to aOutputStream
strm
as a double primitive.- Parameters:
d
- the Double to write.strm
- theOutputStream
to which the Double's value will be written.byteOrder
- theByteOrder
of the data in the stream. Iff
isnull
, no data are written.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Double
Write a single double to aOutputStream
strm
.- Parameters:
d
- the double to write.strm
- theOutputStream
to which the double's value will be written. Iff
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Double
Write a single Double to aRandomAccessFile
f
as a double primitive.- Parameters:
d
- the Double to write.f
- theRandomAccessFile
to which the Double's value will be written.byteOrder
- theByteOrder
of the data in the stream. Iff
isnull
, no data are written.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
Double
Write a single double to aRandomAccessFile
f
.- Parameters:
d
- the double to write.f
- theRandomAccessFile
to which the double's value will be written. Iff
isnull
, no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
String
Write a String to aOutputStream
strm
. The String is encoded using UTF-8 Character Encoding.- Parameters:
s
- the String to write.strm
- theOutputStream
to which the String will be written.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
String
Write a String to aOutputStream
strm
. The String is encoded using the specified Charset's Character Encoding.- Parameters:
s
- the String to write.strm
- theOutputStream
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 beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
ByteArray
Write an array of byte values to aOutputStream
strm
.- Parameters:
b
- the array of bytes to write.strm
- theOutputStream
to which the bytes will be written. Ifstrm
isnull
, no data are written.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
BitSet
Writes aBitSet
as individual bits to aOutputStream
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:
bitSet
- theBitSet
of values to write.strm
- theOutputStream
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:
IOException
- if writing can't be completed due to an I/O error.
-
BitSet
Writes aBitSet
as individual bits to aRandomAccessFile
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:
bitSet
- theBitSet
of values to write.f
- theRandomAccessFile
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 rounded up to the nearest full byte.
- Throws:
IOException
- if writing can't be completed due to an I/O error.
-
ShortArray
public static long ShortArray(short[] sArray, OutputStream strm, ByteOrder byteOrder) throws IOException Write an array of short values to aOutputStream
strm
.- Parameters:
sArray
- the array of shorts to write.strm
- theOutputStream
to which the shorts will be written. Ifstrm
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
ShortArray
public static long ShortArray(short[] sArray, RandomAccessFile f, ByteOrder byteOrder) throws IOException Write an array of short values to aRandomAccessFile
f
.- Parameters:
sArray
- the array of shorts to write.f
- theRandomAccessFile
to which the shorts will be written. Iff
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
ShortArray
public static long ShortArray(short[] sArray, int off, int len, RandomAccessFile f, ByteOrder byteOrder) throws IOException Write an array of short values to aRandomAccessFile
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
- theRandomAccessFile
to which the shorts will be written. Iff
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
IntArray
public static long IntArray(int[] iArray, OutputStream strm, ByteOrder byteOrder) throws IOException Write an array of int values to aOutputStream
strm
.- Parameters:
iArray
- the array of ints to write.strm
- theOutputStream
to which the ints will be written. Ifstrm
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
IntArray
public static long IntArray(int[] iArray, RandomAccessFile f, ByteOrder byteOrder) throws IOException Write an array of int values to aRandomAccessFile
f
.- Parameters:
iArray
- the array of ints to write.f
- theRandomAccessFile
to which the ints will be written. Ifstrm
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
IntArray
public static long IntArray(int[] iArray, int off, int len, RandomAccessFile f, ByteOrder byteOrder) throws IOException Write an array of int values to aRandomAccessFile
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
- theRandomAccessFile
to which the ints will be written. Ifstrm
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
LongArray
public static long LongArray(long[] lArray, OutputStream strm, ByteOrder byteOrder) throws IOException Write an array of long values to aOutputStream
strm
.- Parameters:
lArray
- the array of longs to write.strm
- theOutputStream
to which the longs will be written. Ifstrm
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
LongArray
public static long LongArray(long[] lArray, RandomAccessFile f, ByteOrder byteOrder) throws IOException Write an array of long values to aRandomAccessFile
f
.- Parameters:
lArray
- the array of longs to write.f
- theRandomAccessFile
to which the longs will be written. Ifstrm
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
LongArray
public static long LongArray(long[] lArray, int off, int len, RandomAccessFile f, ByteOrder byteOrder) throws IOException Write an array of long values to aRandomAccessFile
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
- theRandomAccessFile
to which the longs will be written. Ifstrm
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
FloatArray
public static long FloatArray(float[] fArray, OutputStream strm, ByteOrder byteOrder) throws IOException Write an array of float values to aOutputStream
strm
.- Parameters:
fArray
- the array of floats to write.strm
- theOutputStream
to which the floats will be written. Ifstrm
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
FloatArray
public static long FloatArray(float[] fArray, RandomAccessFile f, ByteOrder byteOrder) throws IOException Write an array of float values to aRandomAccessFile
f
.- Parameters:
fArray
- the array of floats to write.f
- theRandomAccessFile
to which the floats will be written. Ifstrm
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
FloatArray
public static long FloatArray(float[] fArray, int off, int len, RandomAccessFile f, ByteOrder byteOrder) throws IOException Write an array of float values to aRandomAccessFile
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
- theRandomAccessFile
to which the floats will be written. Ifstrm
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
DoubleArray
public static long DoubleArray(double[] dArray, OutputStream strm, ByteOrder byteOrder) throws IOException Write an array of double values to aOutputStream
strm
.- Parameters:
dArray
- the array of doubles to write.strm
- theOutputStream
to which the doubles will be written. Ifstrm
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strm
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
DoubleArray
public static long DoubleArray(double[] dArray, RandomAccessFile f, ByteOrder byteOrder) throws IOException Write an array of double values to aRandomAccessFile
f
.- Parameters:
dArray
- the array of doubles to write.f
- theRandomAccessFile
to which the doubles will be written. Ifstrm
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-
DoubleArray
public static long DoubleArray(double[] dArray, int off, int len, RandomAccessFile f, ByteOrder byteOrder) throws IOException Write an array of double values to aRandomAccessFile
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
- theRandomAccessFile
to which the doubles will be written. Ifstrm
isnull
no data are written.byteOrder
- theByteOrder
of the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
f
had not beennull
. - Throws:
IOException
- if an error occurs while performing the write.
-