Package nom.tam.util

Interface ArrayDataInput

    • Method Detail

      • mark

        void mark​(int readlimit)
           throws java.io.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:
        java.io.IOException - if the operation failed
        See Also:
        BufferedInputStream.reset()
      • read

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

        int read​(byte[] buf,
                 int offset,
                 int size)
          throws java.io.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:
        java.io.IOException - if one of the underlying read operations failed
        See Also:
        readFully(byte[], int, int)
      • read

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

        int read​(boolean[] buf,
                 int offset,
                 int size)
          throws java.io.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:
        java.io.IOException - if one of the underlying read operations failed
      • read

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

        int read​(char[] buf,
                 int offset,
                 int size)
          throws java.io.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:
        java.io.IOException - if one of the underlying read operations failed
      • read

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

        int read​(double[] buf,
                 int offset,
                 int size)
          throws java.io.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:
        java.io.IOException - if one of the underlying read operations failed
      • read

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

        int read​(float[] buf,
                 int offset,
                 int size)
          throws java.io.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:
        java.io.IOException - if one of the underlying read operations failed
      • read

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

        int read​(int[] buf,
                 int offset,
                 int size)
          throws java.io.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:
        java.io.IOException - if one of the underlying read operations failed
      • read

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

        int read​(long[] buf,
                 int offset,
                 int size)
          throws java.io.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:
        java.io.IOException - if one of the underlying read operations failed
      • read

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

        int read​(short[] buf,
                 int offset,
                 int size)
          throws java.io.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:
        java.io.IOException - if one of the underlying read operations failed
      • readArray

        @Deprecated
        int readArray​(java.lang.Object o)
               throws java.io.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:
        java.io.IOException - if the underlying stream failed
      • readLArray

        long readLArray​(java.lang.Object o)
                 throws java.io.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:
        java.io.IOException - if the underlying stream failed
      • reset

        void reset()
            throws java.io.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:
        java.io.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:
        BufferedInputStream.mark(int)
      • skip

        long skip​(long distance)
           throws java.io.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:
        java.io.IOException - if the underlying stream failed
      • skipAllBytes

        void skipAllBytes​(long toSkip)
                   throws java.io.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:
        java.io.IOException - if the underlying stream failed
      • skipAllBytes

        void skipAllBytes​(int toSkip)
                   throws java.io.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:
        java.io.IOException - if the underlying stream failed
      • readFully

        void readFully​(byte[] b,
                       int off,
                       int len)
                throws java.io.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 java.io.DataInput
        Parameters:
        b - The input buffer.
        off - The requested offset into the buffer.
        len - The number of bytes requested.
        Throws:
        java.io.IOException