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

public interface ArrayDataOutput extends OutputWriter, DataOutput, FitsIO
Interface for writing array data to outputs.
  • Method Details

    • flush

      void flush() throws IOException
      Flush the output buffer
      Throws:
      IOException - if the flush of the underlying stream failed
    • write

      default void write(boolean[] buf) throws IOException
      Write an array of boolean's.
      Parameters:
      buf - array of boolean's.
      Throws:
      IOException - if one of the underlying write operations failed
    • write

      void write(boolean[] buf, int offset, int size) throws IOException
      Write a segment of an array of boolean's.
      Parameters:
      buf - array of boolean's.
      offset - start index in the array
      size - number of array elements to write
      Throws:
      IOException - if one of the underlying write operations failed
    • write

      default void write(Boolean[] buf) throws IOException
      Write an array of booleans, including legal null values.
      Parameters:
      buf - array of booleans.
      Throws:
      IOException - if one of the underlying write operations failed
      Since:
      1.16
    • write

      default void write(Boolean[] buf, int offset, int size) throws IOException
      Write a segment of an array of booleans, possibly including legal null values. The method has a default implementation, which calls DataOutput.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 array
      size - number of array elements to write
      Throws:
      IOException - if one of the underlying write operations failed
      Since:
      1.16
    • write

      default void write(char[] buf) throws IOException
      Write an array of char's.
      Parameters:
      buf - array of char's.
      Throws:
      IOException - if one of the underlying write operations failed
    • write

      void write(char[] buf, int offset, int size) throws IOException
      Write a segment of an array of char's.
      Parameters:
      buf - array of char's.
      offset - start index in the array
      size - number of array elements to write
      Throws:
      IOException - if one of the underlying write operations failed
    • write

      default void write(double[] buf) throws IOException
      Write an array of double's.
      Parameters:
      buf - array of double's.
      Throws:
      IOException - if one of the underlying write operations failed
    • write

      void write(double[] buf, int offset, int size) throws IOException
      Write a segment of an array of double's.
      Parameters:
      buf - array of double's.
      offset - start index in the array
      size - number of array elements to write
      Throws:
      IOException - if one of the underlying write operations failed
    • write

      default void write(float[] buf) throws IOException
      Write an array of float's.
      Parameters:
      buf - array of float's.
      Throws:
      IOException - if one of the underlying write operations failed
    • write

      void write(float[] buf, int offset, int size) throws IOException
      Write a segment of an array of float's.
      Parameters:
      buf - array of float's.
      offset - start index in the array
      size - number of array elements to write
      Throws:
      IOException - if one of the underlying write operations failed
    • write

      default void write(int[] buf) throws IOException
      Write an array of int's.
      Parameters:
      buf - array of int's
      Throws:
      IOException - if one of the underlying write operations failed
    • write

      void write(int[] buf, int offset, int size) throws IOException
      Write a segment of an array of int's.
      Parameters:
      buf - array of int's
      offset - start index in the array
      size - number of array elements to write
      Throws:
      IOException - if one of the underlying write operations failed
    • write

      default void write(long[] buf) throws IOException
      Write an array of longs.
      Parameters:
      buf - array of longs
      Throws:
      IOException - if one of the underlying write operations failed
    • write

      void write(long[] buf, int offset, int size) throws IOException
      Write a segment of an array of longs.
      Parameters:
      buf - array of longs
      offset - start index in the array
      size - number of array elements to write
      Throws:
      IOException - if one of the underlying write operations failed
    • write

      default void write(short[] buf) throws IOException
      Write an array of shorts.
      Parameters:
      buf - the value to write
      Throws:
      IOException - if one of the underlying write operations failed
    • write

      void write(short[] buf, int offset, int size) throws IOException
      Write a segment of an array of shorts.
      Parameters:
      buf - the value to write
      offset - start index in the array
      size - number of array elements to write
      Throws:
      IOException - if one of the underlying write operations failed
    • write

      default void write(String[] buf) throws IOException
      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

      void write(String[] buf, int offset, int size) throws IOException
      Write a segment of an array of Strings. Equivalent to calling writeBytes for the selected elements.
      Parameters:
      buf - the array to write
      offset - start index in the array
      size - number of array elements to write
      Throws:
      IOException - if one of the underlying write operations failed
    • writeArray

      void writeArray(Object o) throws IOException, IllegalArgumentException
      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. If null nothing will be written to the output.
      Throws:
      IOException - if there was an IO error writing to the output
      IllegalArgumentException - if the supplied object is not a Java array or if it contains Java types that are not supported by the encoder.