Package nom.tam.util
Interface ArrayDataOutput
- All Superinterfaces:
AutoCloseable
,Closeable
,DataOutput
,FitsIO
,OutputWriter
- All Known Subinterfaces:
FitsOutput
- All Known Implementing Classes:
BufferedDataOutputStream
,BufferedFile
,FitsFile
,FitsOutputStream
Interface for writing array data to outputs.
-
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 bufferdefault void
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.default 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.default 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.default 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.default 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.default 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.default 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.default void
Write an array of booleans, including legalnull
values.default void
Write a segment of an array of booleans, possibly including legalnull
values.default void
Write an array of Strings.void
Write a segment of an array of Strings.void
writeArray
(Object o) Writes the contents of a Java array to the output translating the data to the required binary representation.Methods inherited from interface java.io.DataOutput
write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
Methods inherited from interface nom.tam.util.OutputWriter
write, write
-
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 booleans, including legalnull
values.- Parameters:
buf
- array of booleans.- Throws:
IOException
- if one of the underlying write operations failed- Since:
- 1.16
-
write
Write a segment of an array of booleans, possibly including legalnull
values. The method has a default implementation, which callsDataOutput.writeBoolean(boolean)
element by element. Classes that implement this interface might want to replace that with a more efficient block read implementation/- Parameters:
buf
- array of booleans.offset
- start index in the arraysize
- number of array elements to write- Throws:
IOException
- if one of the underlying write operations failed- Since:
- 1.16
-
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
Writes the contents of a Java array to the output translating the data to the required binary representation. The argument may be a generic Java array, including multi-dimensional arrays and heterogeneous arrays of arrays.- Parameters:
o
- the Java array, including heterogeneous arrays of arrays. Ifnull
nothing will be written to the output.- Throws:
IOException
- if there was an IO error writing to the outputIllegalArgumentException
- if the supplied object is not a Java array or if it contains Java types that are not supported by the encoder.
-