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 longBitSet(BitSet bitSet, OutputStream strm) static longBitSet(BitSet bitSet, RandomAccessFile f, int bitOffset) static longByte(byte b, OutputStream strm) Write a single byte value to anOutputStreamstrm.static longByte(byte b, RandomAccessFile f) Write a single byte value to aRandomAccessFilef.static longByteArray(byte[] b, OutputStream strm) Write an array of byte values to aOutputStreamstrm.static longDouble(double d, OutputStream strm, ByteOrder byteOrder) Write a single double to aOutputStreamstrm.static longDouble(double d, RandomAccessFile f, ByteOrder byteOrder) Write a single double to aRandomAccessFilef.static longDouble(Double d, OutputStream strm, ByteOrder byteOrder) Write a single Double to aOutputStreamstrmas a double primitive.static longDouble(Double d, RandomAccessFile f, ByteOrder byteOrder) Write a single Double to aRandomAccessFilefas a double primitive.static longDoubleArray(double[] dArray, int off, int len, RandomAccessFile f, ByteOrder byteOrder) Write an array of double values to aRandomAccessFilef.static longDoubleArray(double[] dArray, OutputStream strm, ByteOrder byteOrder) Write an array of double values to aOutputStreamstrm.static longDoubleArray(double[] dArray, RandomAccessFile f, ByteOrder byteOrder) Write an array of double values to aRandomAccessFilef.static longFloat(float f, OutputStream strm, ByteOrder byteOrder) Write a single float to aOutputStreamstrm.static longFloat(float flt, RandomAccessFile f, ByteOrder byteOrder) Write a single float to aRandomAccessFilef.static longFloat(Float f, OutputStream strm, ByteOrder byteOrder) Write a single Float to aOutputStreamstrmas a float primitive.static longFloat(Float flt, RandomAccessFile f, ByteOrder byteOrder) Write a single Float to aRandomAccessFilefas a float primitive.static longFloatArray(float[] fArray, int off, int len, RandomAccessFile f, ByteOrder byteOrder) Write an array of float values to aRandomAccessFilef.static longFloatArray(float[] fArray, OutputStream strm, ByteOrder byteOrder) Write an array of float values to aOutputStreamstrm.static longFloatArray(float[] fArray, RandomAccessFile f, ByteOrder byteOrder) Write an array of float values to aRandomAccessFilef.static longIntArray(int[] iArray, int off, int len, RandomAccessFile f, ByteOrder byteOrder) Write an array of int values to aRandomAccessFilef.static longIntArray(int[] iArray, OutputStream strm, ByteOrder byteOrder) Write an array of int values to aOutputStreamstrm.static longIntArray(int[] iArray, RandomAccessFile f, ByteOrder byteOrder) Write an array of int values to aRandomAccessFilef.static longInteger(int i, OutputStream strm, ByteOrder byteOrder) Write a single int to aOutputStreamstrm.static longInteger(int i, RandomAccessFile f, ByteOrder byteOrder) Write a single int to aRandomAccessFilef.static longInteger(Integer i, OutputStream strm, ByteOrder byteOrder) Write a single Integer to aOutputStreamstrmas a primitive int value.static longInteger(Integer i, RandomAccessFile f, ByteOrder byteOrder) Write a single Integer to aRandomAccessFilefas a primitive int value.static longLong(long l, OutputStream strm, ByteOrder byteOrder) Write a single long to aOutputStreamstrm.static longLong(long l, RandomAccessFile f, ByteOrder byteOrder) Write a single long to aRandomAccessFilef.static longLongArray(long[] lArray, int off, int len, RandomAccessFile f, ByteOrder byteOrder) Write an array of long values to aRandomAccessFilef.static longLongArray(long[] lArray, OutputStream strm, ByteOrder byteOrder) Write an array of long values to aOutputStreamstrm.static longLongArray(long[] lArray, RandomAccessFile f, ByteOrder byteOrder) Write an array of long values to aRandomAccessFilef.static longShort(short s, OutputStream strm, ByteOrder byteOrder) Write a single short to aOutputStreamstrm.static longShort(short s, RandomAccessFile f, ByteOrder byteOrder) Write a single short to aRandomAccessFilef.static longShort(Short s, OutputStream strm, ByteOrder byteOrder) Write a single Short to aOutputStreamstrmas a primitive short value.static longShort(Short s, RandomAccessFile f, ByteOrder byteOrder) Write a single Short to aRandomAccessFilefas a primitive short value.static longShortArray(short[] sArray, int off, int len, RandomAccessFile f, ByteOrder byteOrder) Write an array of short values to aRandomAccessFilef.static longShortArray(short[] sArray, OutputStream strm, ByteOrder byteOrder) Write an array of short values to aOutputStreamstrm.static longShortArray(short[] sArray, RandomAccessFile f, ByteOrder byteOrder) Write an array of short values to aRandomAccessFilef.static longString(String s, OutputStream strm) Write a String to aOutputStreamstrm.static longString(String s, OutputStream strm, Charset charset) Write a String to aOutputStreamstrm.static longUInteger(long l, OutputStream strm, ByteOrder byteOrder) Write a single long to aOutputStreamstrmas an unsigned int value.static longUInteger(long l, RandomAccessFile f, ByteOrder byteOrder) Write a single Long to aRandomAccessFilefas an unsigned int value.static longUInteger(Long l, OutputStream strm, ByteOrder byteOrder) Write a single Long to aOutputStreamstrmas an unsigned int value.static longUInteger(Long l, RandomAccessFile f, ByteOrder byteOrder) Write a single Long to aOutputStreamstrmas an unsigned int value.static longUShort(int i, OutputStream strm, ByteOrder byteOrder) Write a single int to aOutputStreamstrmas an unsigned short value.static longUShort(int i, RandomAccessFile f, ByteOrder byteOrder) Write a single int to aRandomAccessFilefas an unsigned short value.static longUShort(Integer i, OutputStream strm, ByteOrder byteOrder) Write a single Integer to aOutputStreamstrmas an unsigned short value.static longUShort(Integer i, RandomAccessFile f, ByteOrder byteOrder) Write a single Integer to aRandomAccessFilefas an unsigned short value.
-
Method Details
-
Byte
Write a single byte value to anOutputStreamstrm.- Parameters:
b- the byte to write.strm- theOutputStreamto which the byte will be written. Ifstrmisnull, no data are written.- Returns:
- the number of bytes written, or that would have been written if
strmhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Byte
Write a single byte value to aRandomAccessFilef.- Parameters:
b- the byte to write.f- theRandomAccessFileto which the byte will be written. Iffisnull, no data are written.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Short
Write a single Short to aOutputStreamstrmas a primitive short value.- Parameters:
s- the Short to write.strm- theOutputStreamto which the Short's short value will be written. Ifstrmisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strmhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Short
Write a single short to aOutputStreamstrm.- Parameters:
s- the short to write.strm- theOutputStreamto which the short value will be written. Ifstrmisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strmhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Short
Write a single Short to aRandomAccessFilefas a primitive short value.- Parameters:
s- the Short to write.f- theRandomAccessFileto which the Short's short value will be written. Iffisnullno data are written.byteOrder- theByteOrderof the data in the file.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Short
Write a single short to aRandomAccessFilef.- Parameters:
s- the short to write.f- theRandomAccessFileto which the short value will be written. Iffisnullno data are written.byteOrder- theByteOrderof the data in the file.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
UShort
Write a single Integer to aOutputStreamstrmas 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- theOutputStreamto which the Integer's value will be written as an unsigned short. Ifstrmisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strmhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
UShort
Write a single int to aOutputStreamstrmas 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- theOutputStreamto which the int's value will be written as an unsigned short. Ifstrmisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strmhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
UShort
Write a single Integer to aRandomAccessFilefas 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- theRandomAccessFileto which the Integer's value will be written as an unsigned short. Iffisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
UShort
Write a single int to aRandomAccessFilefas 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- theRandomAccessFileto which the int's value will be written as an unsigned short. Iffisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Integer
Write a single Integer to aOutputStreamstrmas a primitive int value.- Parameters:
i- the Integer to write.strm- theOutputStreamto which the Integer's value will be written as an int. Ifstrmisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strmhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Integer
Write a single int to aOutputStreamstrm.- Parameters:
i- the int to write.strm- theOutputStreamto which the int's value will be written. Ifstrmisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strmhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Integer
Write a single Integer to aRandomAccessFilefas a primitive int value.- Parameters:
i- the Integer to write.f- theRandomAccessFileto which the Integer's value will be written as an int. Iffisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Integer
Write a single int to aRandomAccessFilef.- Parameters:
i- the int to write.f- theRandomAccessFileto which the int's value will be written. Iffisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
UInteger
Write a single Long to aOutputStreamstrmas 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- theOutputStreamto which the Long's value will be written as an unsigned int. Ifstrmisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strmhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
UInteger
Write a single long to aOutputStreamstrmas 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- theOutputStreamto which the long's value will be written as an unsigned int. Ifstrmisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strmhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
UInteger
Write a single Long to aOutputStreamstrmas 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- theRandomAccessFileto which the unsigned integer value will be written as an int. Iffisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
UInteger
Write a single Long to aRandomAccessFilefas 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- theRandomAccessFileto which the unsigned int value will be written. Iffisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Long
Write a single long to aOutputStreamstrm.- Parameters:
l- the long to write.strm- theOutputStreamto which the long's value will be written. Ifstrmisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strmhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Long
Write a single long to aRandomAccessFilef.- Parameters:
l- the long to write.f- theRandomAccessFileto which the long's value will be written. Iffisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Float
Write a single Float to aOutputStreamstrmas a float primitive.- Parameters:
f- the Float to write.strm- theOutputStreamto which the Float's value will be written. Ifstrmisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strmhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Float
Write a single float to aOutputStreamstrm.- Parameters:
f- the float value to write.strm- theOutputStreamto which the float's value will be written. Ifstrmisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strmhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Float
Write a single Float to aRandomAccessFilefas a float primitive.- Parameters:
flt- the Float to write.f- theRandomAccessFileto which the Float's value will be written. Iffisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Float
Write a single float to aRandomAccessFilef.- Parameters:
flt- the float to write.f- theRandomAccessFileto which the float's value will be written. Iffisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Double
Write a single Double to aOutputStreamstrmas a double primitive.- Parameters:
d- the Double to write.strm- theOutputStreamto which the Double's value will be written.byteOrder- theByteOrderof the data in the stream. Iffisnull, no data are written.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Double
Write a single double to aOutputStreamstrm.- Parameters:
d- the double to write.strm- theOutputStreamto which the double's value will be written. Iffisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Double
Write a single Double to aRandomAccessFilefas a double primitive.- Parameters:
d- the Double to write.f- theRandomAccessFileto which the Double's value will be written.byteOrder- theByteOrderof the data in the stream. Iffisnull, no data are written.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
Double
Write a single double to aRandomAccessFilef.- Parameters:
d- the double to write.f- theRandomAccessFileto which the double's value will be written. Iffisnull, no data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
String
Write a String to aOutputStreamstrm. The String is encoded using UTF-8 Character Encoding.- Parameters:
s- the String to write.strm- theOutputStreamto which the String will be written.- Returns:
- the number of bytes written, or that would have been written if
strmhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
String
Write a String to aOutputStreamstrm. The String is encoded using the specified Charset's Character Encoding.- Parameters:
s- the String to write.strm- theOutputStreamto 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
strmhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
ByteArray
Write an array of byte values to aOutputStreamstrm.- Parameters:
b- the array of bytes to write.strm- theOutputStreamto which the bytes will be written. Ifstrmisnull, no data are written.- Returns:
- the number of bytes written, or that would have been written if
strmhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-
BitSet
Writes aBitSetas individual bits to aOutputStreamstrm.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- theBitSetof values to write.strm- theOutputStreamto 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 aBitSetas individual bits to aRandomAccessFilef.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- theBitSetof values to write.f- theRandomAccessFileto 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 aOutputStreamstrm.- Parameters:
sArray- the array of shorts to write.strm- theOutputStreamto which the shorts will be written. Ifstrmisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strmhad 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 aRandomAccessFilef.- Parameters:
sArray- the array of shorts to write.f- theRandomAccessFileto which the shorts will be written. Iffisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad 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 aRandomAccessFilef.- 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- theRandomAccessFileto which the shorts will be written. Iffisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad 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 aOutputStreamstrm.- Parameters:
iArray- the array of ints to write.strm- theOutputStreamto which the ints will be written. Ifstrmisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strmhad 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 aRandomAccessFilef.- Parameters:
iArray- the array of ints to write.f- theRandomAccessFileto which the ints will be written. Ifstrmisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad 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 aRandomAccessFilef.- 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- theRandomAccessFileto which the ints will be written. Ifstrmisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad 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 aOutputStreamstrm.- Parameters:
lArray- the array of longs to write.strm- theOutputStreamto which the longs will be written. Ifstrmisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strmhad 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 aRandomAccessFilef.- Parameters:
lArray- the array of longs to write.f- theRandomAccessFileto which the longs will be written. Ifstrmisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad 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 aRandomAccessFilef.- 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- theRandomAccessFileto which the longs will be written. Ifstrmisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad 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 aOutputStreamstrm.- Parameters:
fArray- the array of floats to write.strm- theOutputStreamto which the floats will be written. Ifstrmisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strmhad 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 aRandomAccessFilef.- Parameters:
fArray- the array of floats to write.f- theRandomAccessFileto which the floats will be written. Ifstrmisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad 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 aRandomAccessFilef.- 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- theRandomAccessFileto which the floats will be written. Ifstrmisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad 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 aOutputStreamstrm.- Parameters:
dArray- the array of doubles to write.strm- theOutputStreamto which the doubles will be written. Ifstrmisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
strmhad 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 aRandomAccessFilef.- Parameters:
dArray- the array of doubles to write.f- theRandomAccessFileto which the doubles will be written. Ifstrmisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad 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 aRandomAccessFilef.- 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- theRandomAccessFileto which the doubles will be written. Ifstrmisnullno data are written.byteOrder- theByteOrderof the data in the stream.- Returns:
- the number of bytes written, or that would have been written if
fhad not beennull. - Throws:
IOException- if an error occurs while performing the write.
-