Package nom.tam.util

Class BufferedFile

    • Constructor Summary

      Constructors 
      Constructor Description
      BufferedFile​(java.io.File file)
      Create a buffered file from a File descriptor
      BufferedFile​(java.io.File file, java.lang.String mode)
      Create a buffered file from a File descriptor
      BufferedFile​(java.io.File file, java.lang.String mode, int bufferSize)
      Create a buffered file from a file descriptor
      BufferedFile​(java.lang.String filename)
      Create a read-only buffered file
      BufferedFile​(java.lang.String filename, java.lang.String mode)
      Create a buffered file with the given mode.
      BufferedFile​(java.lang.String filename, java.lang.String mode, int bufferSize)
      Create a buffered file with the given mode and a specified dataBuffer.buffer size.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void close()  
      protected void finalize()  
      void flush()
      Flush the output buffer
      java.nio.channels.FileChannel getChannel()
      Get the channel associated with this file.
      java.io.FileDescriptor getFD()
      Get the file descriptor associated with this stream.
      long getFilePointer()
      Get the current offset into the file.
      long length()  
      void mark​(int readlimit)
      See the general contract of the mark method of InputStream.
      int read()  
      int read​(boolean[] b)
      Read an array of boolean's.
      int read​(boolean[] b, int start, int length)
      Read a segment of an array of boolean's.
      int read​(byte[] buf)
      Read an array of byte's.
      int read​(byte[] buf, int offset, int len)
      Read a segment of an array of byte's.
      int read​(char[] c)
      Read an array of char's.
      int read​(char[] c, int start, int length)
      Read a segment of an array of char's.
      int read​(double[] d)
      Read an array of double's.
      int read​(double[] d, int start, int length)
      Read a segment of an array of double's.
      int read​(float[] f)
      Read an array of float's.
      int read​(float[] f, int start, int length)
      Read a segment of an array of float's.
      int read​(int[] i)
      Read an array of int's.
      int read​(int[] i, int start, int length)
      Read a segment of an array of int's.
      int read​(long[] l)
      Read a segment of an array of long's.
      int read​(long[] l, int start, int length)
      Read a segment of an array of long's.
      int read​(short[] s)
      Read an array of short's.
      int read​(short[] s, int start, int length)
      Read a segment of an array of short's.
      int readArray​(java.lang.Object o)
      Deprecated.
      boolean readBoolean()  
      byte readByte()  
      char readChar()  
      double readDouble()  
      float readFloat()  
      void readFully​(byte[] b)  
      void readFully​(byte[] b, int off, int len)
      Read a buffer and signal an EOF if the requested elements cannot be read.
      int readInt()  
      long readLArray​(java.lang.Object o)
      Read an object.
      java.lang.String readLine()
      Read a line of input.
      long readLong()  
      short readShort()  
      int readUnsignedByte()  
      int readUnsignedShort()  
      java.lang.String readUTF()  
      void reset()
      See the general contract of the reset method of InputStream.
      void seek​(long offsetFromStart)
      Move to a specified location in the stream.
      void setLength​(long newLength)
      Set the length of the file.
      long skip​(long offset)
      Skip the number of bytes.
      void skipAllBytes​(int toSkip)
      Skip the number of bytes.
      void skipAllBytes​(long toSkip)
      Skip the number of bytes.
      int skipBytes​(int n)  
      void write​(boolean[] b)
      Write an array of boolean's.
      void write​(boolean[] b, int start, int length)
      Write a segment of an array of boolean's.
      void write​(byte[] buf)  
      void write​(byte[] buf, int offset, int length)  
      void write​(char[] c)
      Write an array of char's.
      void write​(char[] c, int start, int length)
      Write a segment of an array of char's.
      void write​(double[] d)
      Write an array of double's.
      void write​(double[] d, int start, int length)
      Write a segment of an array of double's.
      void write​(float[] f)
      Write an array of float's.
      void write​(float[] f, int start, int length)
      Write a segment of an array of float's.
      void write​(int buf)  
      void write​(int[] i)
      Write an array of int's.
      void write​(int[] i, int start, int length)
      Write a segment of an array of int's.
      void write​(long[] l)
      Write an array of longs.
      void write​(long[] l, int start, int length)
      Write a segment of an array of longs.
      void write​(short[] s)
      Write an array of shorts.
      void write​(short[] s, int start, int length)
      Write a segment of an array of shorts.
      void write​(java.lang.String[] s)
      Write an array of Strings.
      void write​(java.lang.String[] s, int start, int length)
      Write a segment of an array of Strings.
      void writeArray​(java.lang.Object o)
      This routine provides efficient writing of arrays of any primitive type.
      void writeBoolean​(boolean b)  
      void writeByte​(int b)  
      void writeBytes​(java.lang.String s)  
      void writeChar​(int c)  
      void writeChars​(java.lang.String s)  
      void writeDouble​(double d)  
      void writeFloat​(float f)  
      void writeInt​(int i)  
      void writeLong​(long l)  
      void writeShort​(int s)  
      void writeUTF​(java.lang.String s)  
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BufferedFile

        public BufferedFile​(java.io.File file)
                     throws java.io.IOException
        Create a buffered file from a File descriptor
        Parameters:
        file - the file to open.
        Throws:
        java.io.IOException - if the file could not be opened
      • BufferedFile

        public BufferedFile​(java.io.File file,
                            java.lang.String mode)
                     throws java.io.IOException
        Create a buffered file from a File descriptor
        Parameters:
        file - the file to open.
        mode - the mode to open the file in
        Throws:
        java.io.IOException - if the file could not be opened
      • BufferedFile

        public BufferedFile​(java.io.File file,
                            java.lang.String mode,
                            int bufferSize)
                     throws java.io.IOException
        Create a buffered file from a file descriptor
        Parameters:
        file - the file to open.
        mode - the mode to open the file in
        bufferSize - the dataBuffer.buffer size to use
        Throws:
        java.io.IOException - if the file could not be opened
      • BufferedFile

        public BufferedFile​(java.lang.String filename)
                     throws java.io.IOException
        Create a read-only buffered file
        Parameters:
        filename - the name of the file to open
        Throws:
        java.io.IOException - if the file could not be opened
      • BufferedFile

        public BufferedFile​(java.lang.String filename,
                            java.lang.String mode)
                     throws java.io.IOException
        Create a buffered file with the given mode.
        Parameters:
        filename - The file to be accessed.
        mode - A string composed of "r" and "w" for read and write access.
        Throws:
        java.io.IOException - if the file could not be opened
      • BufferedFile

        public BufferedFile​(java.lang.String filename,
                            java.lang.String mode,
                            int bufferSize)
                     throws java.io.IOException
        Create a buffered file with the given mode and a specified dataBuffer.buffer size.
        Parameters:
        filename - The file to be accessed.
        mode - A string composed of "r" and "w" indicating read or write access.
        bufferSize - The dataBuffer.buffer size to be used. This should be substantially larger than 100 bytes and defaults to 32768 bytes in the other constructors.
        Throws:
        java.io.IOException - if the file could not be opened
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface FitsIO
        Throws:
        java.io.IOException
      • finalize

        protected void finalize()
        Overrides:
        finalize in class java.lang.Object
      • flush

        public void flush()
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Flush the output buffer
        Specified by:
        flush in interface ArrayDataOutput
        Throws:
        java.io.IOException - if the flush of the underlying stream failed
      • getChannel

        public java.nio.channels.FileChannel getChannel()
        Get the channel associated with this file. Note that this returns the channel of the associated RandomAccessFile. Note that since the BufferedFile buffers the I/O's to the underlying file, the offset of the channel may be different than the offset of the BufferedFile. This is different than for a RandomAccessFile where the offsets are guaranteed to be the same.
        Returns:
        the file channel
      • getFD

        public java.io.FileDescriptor getFD()
                                     throws java.io.IOException
        Get the file descriptor associated with this stream. Note that this returns the file descriptor of the associated RandomAccessFile.
        Returns:
        the file descriptor
        Throws:
        java.io.IOException - if the descriptor could not be accessed.
      • getFilePointer

        public long getFilePointer()
        Get the current offset into the file.
        Specified by:
        getFilePointer in interface RandomAccess
        Returns:
        the current position in the stream.
      • length

        public long length()
                    throws java.io.IOException
        Returns:
        the current length of the file.
        Throws:
        java.io.IOException - if the operation failed
      • mark

        public void mark​(int readlimit)
                  throws java.io.IOException
        Description copied from interface: ArrayDataInput
        See the general contract of the mark method of InputStream.
        Specified by:
        mark in interface ArrayDataInput
        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

        public int read()
                 throws java.io.IOException
        Returns:
        Read a byte.
        Throws:
        java.io.IOException - if the underlying read operation fails
      • read

        public int read​(boolean[] b)
                 throws java.io.IOException
        Description copied from interface: ArrayDataInput
        Read an array of boolean's.
        Specified by:
        read in interface ArrayDataInput
        Parameters:
        b - array of boolean's.
        Returns:
        number of bytes read.
        Throws:
        java.io.IOException - if one of the underlying read operations failed
      • read

        public int read​(boolean[] b,
                        int start,
                        int length)
                 throws java.io.IOException
        Description copied from interface: ArrayDataInput
        Read a segment of an array of boolean's.
        Specified by:
        read in interface ArrayDataInput
        Parameters:
        b - array of boolean's.
        start - start index in the array
        length - number of array elements to read
        Returns:
        number of bytes read.
        Throws:
        java.io.IOException - if one of the underlying read operations failed
      • read

        public int read​(byte[] buf)
                 throws java.io.IOException
        Description copied from interface: ArrayDataInput
        Read an array of byte's.
        Specified by:
        read in interface ArrayDataInput
        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

        public int read​(byte[] buf,
                        int offset,
                        int len)
                 throws java.io.IOException
        Description copied from interface: ArrayDataInput
        Read a segment of an array of byte's.
        Specified by:
        read in interface ArrayDataInput
        Parameters:
        buf - array of byte's.
        offset - start index in the array
        len - 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:
        ArrayDataInput.readFully(byte[], int, int)
      • read

        public int read​(char[] c)
                 throws java.io.IOException
        Description copied from interface: ArrayDataInput
        Read an array of char's.
        Specified by:
        read in interface ArrayDataInput
        Parameters:
        c - array of char's.
        Returns:
        number of bytes read.
        Throws:
        java.io.IOException - if one of the underlying read operations failed
      • read

        public int read​(char[] c,
                        int start,
                        int length)
                 throws java.io.IOException
        Description copied from interface: ArrayDataInput
        Read a segment of an array of char's.
        Specified by:
        read in interface ArrayDataInput
        Parameters:
        c - array of char's.
        start - start index in the array
        length - number of array elements to read
        Returns:
        number of bytes read.
        Throws:
        java.io.IOException - if one of the underlying read operations failed
      • read

        public int read​(double[] d)
                 throws java.io.IOException
        Description copied from interface: ArrayDataInput
        Read an array of double's.
        Specified by:
        read in interface ArrayDataInput
        Parameters:
        d - array of double's.
        Returns:
        number of bytes read.
        Throws:
        java.io.IOException - if one of the underlying read operations failed
      • read

        public int read​(double[] d,
                        int start,
                        int length)
                 throws java.io.IOException
        Description copied from interface: ArrayDataInput
        Read a segment of an array of double's.
        Specified by:
        read in interface ArrayDataInput
        Parameters:
        d - array of double's.
        start - start index in the array
        length - number of array elements to read
        Returns:
        number of bytes read.
        Throws:
        java.io.IOException - if one of the underlying read operations failed
      • read

        public int read​(float[] f)
                 throws java.io.IOException
        Description copied from interface: ArrayDataInput
        Read an array of float's.
        Specified by:
        read in interface ArrayDataInput
        Parameters:
        f - array of float's.
        Returns:
        number of bytes read.
        Throws:
        java.io.IOException - if one of the underlying read operations failed
      • read

        public int read​(float[] f,
                        int start,
                        int length)
                 throws java.io.IOException
        Description copied from interface: ArrayDataInput
        Read a segment of an array of float's.
        Specified by:
        read in interface ArrayDataInput
        Parameters:
        f - array of float's.
        start - start index in the array
        length - number of array elements to read
        Returns:
        number of bytes read.
        Throws:
        java.io.IOException - if one of the underlying read operations failed
      • read

        public int read​(int[] i)
                 throws java.io.IOException
        Description copied from interface: ArrayDataInput
        Read an array of int's.
        Specified by:
        read in interface ArrayDataInput
        Parameters:
        i - array of int's.
        Returns:
        number of bytes read.
        Throws:
        java.io.IOException - if one of the underlying read operations failed
      • read

        public int read​(int[] i,
                        int start,
                        int length)
                 throws java.io.IOException
        Description copied from interface: ArrayDataInput
        Read a segment of an array of int's.
        Specified by:
        read in interface ArrayDataInput
        Parameters:
        i - array of int's.
        start - start index in the array
        length - number of array elements to read
        Returns:
        number of bytes read.
        Throws:
        java.io.IOException - if one of the underlying read operations failed
      • read

        public int read​(long[] l)
                 throws java.io.IOException
        Description copied from interface: ArrayDataInput
        Read a segment of an array of long's.
        Specified by:
        read in interface ArrayDataInput
        Parameters:
        l - array of long's.
        Returns:
        number of bytes read.
        Throws:
        java.io.IOException - if one of the underlying read operations failed
      • read

        public int read​(long[] l,
                        int start,
                        int length)
                 throws java.io.IOException
        Description copied from interface: ArrayDataInput
        Read a segment of an array of long's.
        Specified by:
        read in interface ArrayDataInput
        Parameters:
        l - array of long's.
        start - start index in the array
        length - number of array elements to read
        Returns:
        number of bytes read.
        Throws:
        java.io.IOException - if one of the underlying read operations failed
      • read

        public int read​(short[] s)
                 throws java.io.IOException
        Description copied from interface: ArrayDataInput
        Read an array of short's.
        Specified by:
        read in interface ArrayDataInput
        Parameters:
        s - array of short's.
        Returns:
        number of bytes read.
        Throws:
        java.io.IOException - if one of the underlying read operations failed
      • read

        public int read​(short[] s,
                        int start,
                        int length)
                 throws java.io.IOException
        Description copied from interface: ArrayDataInput
        Read a segment of an array of short's.
        Specified by:
        read in interface ArrayDataInput
        Parameters:
        s - array of short's.
        start - start index in the array
        length - 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
        public int readArray​(java.lang.Object o)
                      throws java.io.IOException
        Deprecated.
        Description copied from interface: ArrayDataInput
        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.

        Specified by:
        readArray in interface ArrayDataInput
        Parameters:
        o - A [multidimensional] primitive (or Object) array.
        Returns:
        number of bytes read.
        Throws:
        java.io.IOException - if the underlying stream failed
      • readBoolean

        public boolean readBoolean()
                            throws java.io.IOException
        Specified by:
        readBoolean in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readByte

        public byte readByte()
                      throws java.io.IOException
        Specified by:
        readByte in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readChar

        public char readChar()
                      throws java.io.IOException
        Specified by:
        readChar in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readDouble

        public double readDouble()
                          throws java.io.IOException
        Specified by:
        readDouble in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readFloat

        public float readFloat()
                        throws java.io.IOException
        Specified by:
        readFloat in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readFully

        public void readFully​(byte[] b)
                       throws java.io.IOException
        Specified by:
        readFully in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readFully

        public void readFully​(byte[] b,
                              int off,
                              int len)
                       throws java.io.IOException
        Description copied from interface: ArrayDataInput
        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 ArrayDataInput
        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
      • readInt

        public int readInt()
                    throws java.io.IOException
        Specified by:
        readInt in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readLArray

        public long readLArray​(java.lang.Object o)
                        throws java.io.IOException
        Description copied from interface: ArrayDataInput
        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.
        Specified by:
        readLArray in interface ArrayDataInput
        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
      • readLine

        public java.lang.String readLine()
                                  throws java.io.IOException
        Read a line of input.
        Specified by:
        readLine in interface java.io.DataInput
        Returns:
        the next line.
        Throws:
        java.io.IOException
      • readLong

        public long readLong()
                      throws java.io.IOException
        Specified by:
        readLong in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readShort

        public short readShort()
                        throws java.io.IOException
        Specified by:
        readShort in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readUnsignedByte

        public int readUnsignedByte()
                             throws java.io.IOException
        Specified by:
        readUnsignedByte in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readUnsignedShort

        public int readUnsignedShort()
                              throws java.io.IOException
        Specified by:
        readUnsignedShort in interface java.io.DataInput
        Throws:
        java.io.IOException
      • readUTF

        public java.lang.String readUTF()
                                 throws java.io.IOException
        Specified by:
        readUTF in interface java.io.DataInput
        Throws:
        java.io.IOException
      • reset

        public void reset()
                   throws java.io.IOException
        Description copied from interface: ArrayDataInput
        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.

        Specified by:
        reset in interface ArrayDataInput
        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)
      • seek

        public void seek​(long offsetFromStart)
                  throws java.io.IOException
        Description copied from interface: RandomAccess
        Move to a specified location in the stream.
        Specified by:
        seek in interface RandomAccess
        Parameters:
        offsetFromStart - set the offset messured from the start
        Throws:
        java.io.IOException - if the operation fails
      • setLength

        public void setLength​(long newLength)
                       throws java.io.IOException
        Set the length of the file. This method calls the method of the same name in RandomAccessFile which is only available in JDK1.2 and greater. This method may be deleted for compilation with earlier versions.
        Parameters:
        newLength - The number of bytes at which the file is set.
        Throws:
        java.io.IOException - if the resizing of the underlying stream fails
      • skip

        public long skip​(long offset)
                  throws java.io.IOException
        Description copied from interface: ArrayDataInput
        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).
        Specified by:
        skip in interface ArrayDataInput
        Parameters:
        offset - the number of bytes to skip
        Returns:
        the number of bytes really skipped
        Throws:
        java.io.IOException - if the underlying stream failed
      • skipAllBytes

        public void skipAllBytes​(int toSkip)
                          throws java.io.IOException
        Description copied from interface: ArrayDataInput
        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).
        Specified by:
        skipAllBytes in interface ArrayDataInput
        Parameters:
        toSkip - the number of bytes to skip
        Throws:
        java.io.IOException - if the underlying stream failed
      • skipAllBytes

        public void skipAllBytes​(long toSkip)
                          throws java.io.IOException
        Description copied from interface: ArrayDataInput
        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).
        Specified by:
        skipAllBytes in interface ArrayDataInput
        Parameters:
        toSkip - the number of bytes to skip
        Throws:
        java.io.IOException - if the underlying stream failed
      • skipBytes

        public int skipBytes​(int n)
                      throws java.io.IOException
        Specified by:
        skipBytes in interface java.io.DataInput
        Throws:
        java.io.IOException
      • write

        public void write​(boolean[] b)
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Write an array of boolean's.
        Specified by:
        write in interface ArrayDataOutput
        Parameters:
        b - array of boolean's.
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • write

        public void write​(boolean[] b,
                          int start,
                          int length)
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Write a segment of an array of boolean's.
        Specified by:
        write in interface ArrayDataOutput
        Parameters:
        b - array of boolean's.
        start - start index in the array
        length - number of array elements to write
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • write

        public void write​(byte[] buf)
                   throws java.io.IOException
        Specified by:
        write in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] buf,
                          int offset,
                          int length)
                   throws java.io.IOException
        Specified by:
        write in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • write

        public void write​(char[] c)
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Write an array of char's.
        Specified by:
        write in interface ArrayDataOutput
        Parameters:
        c - array of char's.
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • write

        public void write​(char[] c,
                          int start,
                          int length)
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Write a segment of an array of char's.
        Specified by:
        write in interface ArrayDataOutput
        Parameters:
        c - array of char's.
        start - start index in the array
        length - number of array elements to write
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • write

        public void write​(double[] d)
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Write an array of double's.
        Specified by:
        write in interface ArrayDataOutput
        Parameters:
        d - array of double's.
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • write

        public void write​(double[] d,
                          int start,
                          int length)
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Write a segment of an array of double's.
        Specified by:
        write in interface ArrayDataOutput
        Parameters:
        d - array of double's.
        start - start index in the array
        length - number of array elements to write
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • write

        public void write​(float[] f)
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Write an array of float's.
        Specified by:
        write in interface ArrayDataOutput
        Parameters:
        f - array of float's.
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • write

        public void write​(float[] f,
                          int start,
                          int length)
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Write a segment of an array of float's.
        Specified by:
        write in interface ArrayDataOutput
        Parameters:
        f - array of float's.
        start - start index in the array
        length - number of array elements to write
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • write

        public void write​(int buf)
                   throws java.io.IOException
        Specified by:
        write in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • write

        public void write​(int[] i)
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Write an array of int's.
        Specified by:
        write in interface ArrayDataOutput
        Parameters:
        i - array of int's
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • write

        public void write​(int[] i,
                          int start,
                          int length)
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Write a segment of an array of int's.
        Specified by:
        write in interface ArrayDataOutput
        Parameters:
        i - array of int's
        start - start index in the array
        length - number of array elements to write
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • write

        public void write​(long[] l)
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Write an array of longs.
        Specified by:
        write in interface ArrayDataOutput
        Parameters:
        l - array of longs
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • write

        public void write​(long[] l,
                          int start,
                          int length)
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Write a segment of an array of longs.
        Specified by:
        write in interface ArrayDataOutput
        Parameters:
        l - array of longs
        start - start index in the array
        length - number of array elements to write
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • write

        public void write​(short[] s)
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Write an array of shorts.
        Specified by:
        write in interface ArrayDataOutput
        Parameters:
        s - the value to write
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • write

        public void write​(short[] s,
                          int start,
                          int length)
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Write a segment of an array of shorts.
        Specified by:
        write in interface ArrayDataOutput
        Parameters:
        s - the value to write
        start - start index in the array
        length - number of array elements to write
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • write

        public void write​(java.lang.String[] s)
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Write an array of Strings. Equivalent to calling writeBytes for the selected elements.
        Specified by:
        write in interface ArrayDataOutput
        Parameters:
        s - the array to write
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • write

        public void write​(java.lang.String[] s,
                          int start,
                          int length)
                   throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        Write a segment of an array of Strings. Equivalent to calling writeBytes for the selected elements.
        Specified by:
        write in interface ArrayDataOutput
        Parameters:
        s - the array to write
        start - start index in the array
        length - number of array elements to write
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • writeArray

        public void writeArray​(java.lang.Object o)
                        throws java.io.IOException
        Description copied from interface: ArrayDataOutput
        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.
        Specified by:
        writeArray in interface ArrayDataOutput
        Parameters:
        o - The object to be written. It must be an array of a primitive type, Object, or String.
        Throws:
        java.io.IOException - if one of the underlying write operations failed
      • writeBoolean

        public void writeBoolean​(boolean b)
                          throws java.io.IOException
        Specified by:
        writeBoolean in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeByte

        public void writeByte​(int b)
                       throws java.io.IOException
        Specified by:
        writeByte in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeBytes

        public void writeBytes​(java.lang.String s)
                        throws java.io.IOException
        Specified by:
        writeBytes in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeChar

        public void writeChar​(int c)
                       throws java.io.IOException
        Specified by:
        writeChar in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeChars

        public void writeChars​(java.lang.String s)
                        throws java.io.IOException
        Specified by:
        writeChars in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeDouble

        public void writeDouble​(double d)
                         throws java.io.IOException
        Specified by:
        writeDouble in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeFloat

        public void writeFloat​(float f)
                        throws java.io.IOException
        Specified by:
        writeFloat in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeInt

        public void writeInt​(int i)
                      throws java.io.IOException
        Specified by:
        writeInt in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeLong

        public void writeLong​(long l)
                       throws java.io.IOException
        Specified by:
        writeLong in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeShort

        public void writeShort​(int s)
                        throws java.io.IOException
        Specified by:
        writeShort in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeUTF

        public void writeUTF​(java.lang.String s)
                      throws java.io.IOException
        Specified by:
        writeUTF in interface java.io.DataOutput
        Throws:
        java.io.IOException