Package nom.tam.util

Interface ArrayDataInput

All Superinterfaces:
AutoCloseable, Closeable, DataInput, FitsIO
All Known Subinterfaces:
RandomAccess
All Known Implementing Classes:
BufferedDataInputStream, BufferedFile

public interface ArrayDataInput extends DataInput, FitsIO
  • Method Details

    • mark

      void mark(int readlimit) throws IOException
      See the general contract of the mark method of InputStream.
      Parameters:
      readlimit - the maximum limit of bytes that can be read before the mark position becomes invalid.
      Throws:
      IOException - if the operation failed
      See Also:
    • read

      int read(byte[] buf) throws IOException
      Read an array of byte's.
      Parameters:
      buf - array of byte's.
      Returns:
      number of bytes read.
      Throws:
      IOException - if one of the underlying read operations failed
      See Also:
    • read

      int read(byte[] buf, int offset, int size) throws IOException
      Read a segment of an array of byte's.
      Parameters:
      buf - array of byte's.
      offset - start index in the array
      size - number of array elements to read
      Returns:
      number of bytes read.
      Throws:
      IOException - if one of the underlying read operations failed
      See Also:
    • read

      int read(boolean[] buf) throws IOException
      Read an array of boolean's.
      Parameters:
      buf - array of boolean's.
      Returns:
      number of bytes read.
      Throws:
      IOException - if one of the underlying read operations failed
    • read

      int read(boolean[] buf, int offset, int size) throws IOException
      Read 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 read
      Returns:
      number of bytes read.
      Throws:
      IOException - if one of the underlying read operations failed
    • read

      int read(char[] buf) throws IOException
      Read an array of char's.
      Parameters:
      buf - array of char's.
      Returns:
      number of bytes read.
      Throws:
      IOException - if one of the underlying read operations failed
    • read

      int read(char[] buf, int offset, int size) throws IOException
      Read 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 read
      Returns:
      number of bytes read.
      Throws:
      IOException - if one of the underlying read operations failed
    • read

      int read(double[] buf) throws IOException
      Read an array of double's.
      Parameters:
      buf - array of double's.
      Returns:
      number of bytes read.
      Throws:
      IOException - if one of the underlying read operations failed
    • read

      int read(double[] buf, int offset, int size) throws IOException
      Read 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 read
      Returns:
      number of bytes read.
      Throws:
      IOException - if one of the underlying read operations failed
    • read

      int read(float[] buf) throws IOException
      Read an array of float's.
      Parameters:
      buf - array of float's.
      Returns:
      number of bytes read.
      Throws:
      IOException - if one of the underlying read operations failed
    • read

      int read(float[] buf, int offset, int size) throws IOException
      Read 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 read
      Returns:
      number of bytes read.
      Throws:
      IOException - if one of the underlying read operations failed
    • read

      int read(int[] buf) throws IOException
      Read an array of int's.
      Parameters:
      buf - array of int's.
      Returns:
      number of bytes read.
      Throws:
      IOException - if one of the underlying read operations failed
    • read

      int read(int[] buf, int offset, int size) throws IOException
      Read 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 read
      Returns:
      number of bytes read.
      Throws:
      IOException - if one of the underlying read operations failed
    • read

      int read(long[] buf) throws IOException
      Read a segment of an array of long's.
      Parameters:
      buf - array of long's.
      Returns:
      number of bytes read.
      Throws:
      IOException - if one of the underlying read operations failed
    • read

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

      int read(short[] buf) throws IOException
      Read an array of short's.
      Parameters:
      buf - array of short's.
      Returns:
      number of bytes read.
      Throws:
      IOException - if one of the underlying read operations failed
    • read

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

      @Deprecated int readArray(Object o) throws IOException
      Deprecated.
      use readLArray(Object) instead.
      Read a generic (possibly multidimensional) primitive array. An Object[] array is also a legal argument if each element of the array is a legal.

      The ArrayDataInput classes do not support String input since it is unclear how one would read in an Array of strings.

      Parameters:
      o - A [multidimensional] primitive (or Object) array.
      Returns:
      number of bytes read.
      Throws:
      IOException - if the underlying stream failed
    • readLArray

      long readLArray(Object o) throws IOException
      Read an object. An EOF will be signaled if the object cannot be fully read. This version works even if the underlying data is more than 2 Gigabytes.
      Parameters:
      o - The object to be read. This object should be a primitive (possibly multi-dimensional) array.
      Returns:
      number of bytes read.
      Throws:
      IOException - if the underlying stream failed
    • reset

      void reset() throws IOException
      See the general contract of the reset method of InputStream.

      If markpos is -1 (no mark has been set or the mark has been invalidated), an IOException is thrown. Otherwise, pos is set equal to markpos.

      Throws:
      IOException - if this stream has not been marked or, if the mark has been invalidated, or the stream has been closed by invoking its FitsIO.close() method, or an I/O error occurs.
      See Also:
    • skip

      long skip(long distance) throws IOException
      Skip the number of bytes. This differs from the skip method in that it will throw an EOF if a forward skip cannot be fully accomplished... (However that isn't supposed to happen with a random access file, so there is probably no operational difference).
      Parameters:
      distance - the number of bytes to skip
      Returns:
      the number of bytes really skipped
      Throws:
      IOException - if the underlying stream failed
    • skipAllBytes

      void skipAllBytes(long toSkip) throws IOException
      Skip the number of bytes. This differs from the skip method in that it will throw an EOF if a forward skip cannot be fully accomplished... (However that isn't supposed to happen with a random access file, so there is probably no operational difference).
      Parameters:
      toSkip - the number of bytes to skip
      Throws:
      IOException - if the underlying stream failed
    • skipAllBytes

      void skipAllBytes(int toSkip) throws IOException
      Skip the number of bytes. This differs from the skip method in that it will throw an EOF if a forward skip cannot be fully accomplished... (However that isn't supposed to happen with a random access file, so there is probably no operational difference).
      Parameters:
      toSkip - the number of bytes to skip
      Throws:
      IOException - if the underlying stream failed
    • readFully

      void readFully(byte[] b, int off, int len) throws IOException
      Read a buffer and signal an EOF if the requested elements cannot be read. This differs from read(b,off,len) since that call will not signal and end of file unless no bytes can be read. However both of these routines will attempt to fill their buffers completely.
      Specified by:
      readFully in interface DataInput
      Parameters:
      b - The input buffer.
      off - The requested offset into the buffer.
      len - The number of bytes requested.
      Throws:
      IOException