Package nom.tam.util
Interface ArrayDataOutput
- All Superinterfaces:
AutoCloseable
,Closeable
,DataOutput
,FitsIO
- All Known Implementing Classes:
BufferedDataOutputStream
,BufferedFile
Special high performance scientific extension of the DataOutput interface.
-
Field Summary
Fields inherited from interface nom.tam.util.FitsIO
BITS_OF_1_BYTE, BITS_OF_2_BYTES, BITS_OF_3_BYTES, BITS_OF_4_BYTES, BITS_OF_5_BYTES, BITS_OF_6_BYTES, BITS_OF_7_BYTES, BYTE_1_OF_LONG_MASK, BYTE_2_OF_LONG_MASK, BYTE_3_OF_LONG_MASK, BYTE_4_OF_LONG_MASK, BYTE_MASK, BYTES_IN_BOOLEAN, BYTES_IN_BYTE, BYTES_IN_CHAR, BYTES_IN_DOUBLE, BYTES_IN_FLOAT, BYTES_IN_INTEGER, BYTES_IN_LONG, BYTES_IN_SHORT, DEFAULT_BUFFER_SIZE, HIGH_INTEGER_MASK, INTEGER_MASK, SHORT_MASK, SHORT_OF_LONG_MASK
-
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
Flush the output buffervoid
write
(boolean[] buf) Write an array of boolean's.void
write
(boolean[] buf, int offset, int size) Write a segment of an array of boolean's.void
write
(char[] buf) Write an array of char's.void
write
(char[] buf, int offset, int size) Write a segment of an array of char's.void
write
(double[] buf) Write an array of double's.void
write
(double[] buf, int offset, int size) Write a segment of an array of double's.void
write
(float[] buf) Write an array of float's.void
write
(float[] buf, int offset, int size) Write a segment of an array of float's.void
write
(int[] buf) Write an array of int's.void
write
(int[] buf, int offset, int size) Write a segment of an array of int's.void
write
(long[] buf) Write an array of longs.void
write
(long[] buf, int offset, int size) Write a segment of an array of longs.void
write
(short[] buf) Write an array of shorts.void
write
(short[] buf, int offset, int size) Write a segment of an array of shorts.void
Write an array of Strings.void
Write a segment of an array of Strings.void
writeArray
(Object o) This routine provides efficient writing of arrays of any primitive type.Methods inherited from interface java.io.DataOutput
write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
Method Details
-
flush
Flush the output buffer- Throws:
IOException
- if the flush of the underlying stream failed
-
write
Write an array of boolean's.- Parameters:
buf
- array of boolean's.- Throws:
IOException
- if one of the underlying write operations failed
-
write
Write a segment of an array of boolean's.- Parameters:
buf
- array of boolean's.offset
- start index in the arraysize
- number of array elements to write- Throws:
IOException
- if one of the underlying write operations failed
-
write
Write an array of char's.- Parameters:
buf
- array of char's.- Throws:
IOException
- if one of the underlying write operations failed
-
write
Write a segment of an array of char's.- Parameters:
buf
- array of char's.offset
- start index in the arraysize
- number of array elements to write- Throws:
IOException
- if one of the underlying write operations failed
-
write
Write an array of double's.- Parameters:
buf
- array of double's.- Throws:
IOException
- if one of the underlying write operations failed
-
write
Write a segment of an array of double's.- Parameters:
buf
- array of double's.offset
- start index in the arraysize
- number of array elements to write- Throws:
IOException
- if one of the underlying write operations failed
-
write
Write an array of float's.- Parameters:
buf
- array of float's.- Throws:
IOException
- if one of the underlying write operations failed
-
write
Write a segment of an array of float's.- Parameters:
buf
- array of float's.offset
- start index in the arraysize
- number of array elements to write- Throws:
IOException
- if one of the underlying write operations failed
-
write
Write an array of int's.- Parameters:
buf
- array of int's- Throws:
IOException
- if one of the underlying write operations failed
-
write
Write a segment of an array of int's.- Parameters:
buf
- array of int'soffset
- start index in the arraysize
- number of array elements to write- Throws:
IOException
- if one of the underlying write operations failed
-
write
Write an array of longs.- Parameters:
buf
- array of longs- Throws:
IOException
- if one of the underlying write operations failed
-
write
Write a segment of an array of longs.- Parameters:
buf
- array of longsoffset
- start index in the arraysize
- number of array elements to write- Throws:
IOException
- if one of the underlying write operations failed
-
write
Write an array of shorts.- Parameters:
buf
- the value to write- Throws:
IOException
- if one of the underlying write operations failed
-
write
Write a segment of an array of shorts.- Parameters:
buf
- the value to writeoffset
- start index in the arraysize
- number of array elements to write- Throws:
IOException
- if one of the underlying write operations failed
-
write
Write an array of Strings. Equivalent to calling writeBytes for the selected elements.- Parameters:
buf
- the array to write- Throws:
IOException
- if one of the underlying write operations failed
-
write
Write a segment of an array of Strings. Equivalent to calling writeBytes for the selected elements.- Parameters:
buf
- the array to writeoffset
- start index in the arraysize
- number of array elements to write- Throws:
IOException
- if one of the underlying write operations failed
-
writeArray
This routine provides efficient writing of arrays of any primitive type. The String class is also handled but it is an error to invoke this method with an object that is not an array of these types. If the array is multidimensional, then it calls itself recursively to write the entire array. Strings are written using the standard 1 byte format (i.e., as in writeBytes). If the array is an array of objects, then writePrimitiveArray will be called for each element of the array.- Parameters:
o
- The object to be written. It must be an array of a primitive type, Object, or String.- Throws:
IOException
- if one of the underlying write operations failed
-