edu.mines.jtk.io
Class DataFile

java.lang.Object
  extended by edu.mines.jtk.io.DataFile
All Implemented Interfaces:
java.io.Closeable, java.io.DataInput, java.io.DataOutput

public class DataFile
extends java.lang.Object
implements java.io.DataInput, java.io.DataOutput, java.io.Closeable

A data file has the capabilities of a RandomAccessFile, and more. For example, a data file has methods for efficiently reading and writing arrays of primitive values, such as ints and floats. Also, data files may be read or written with BIG_ENDIAN or LITTLE_ENDIAN byte orders. In other words, a data file is a better random access file.

A data file implements the interfaces DataInput and DataOutput. Those interfaces specify methods for reading single primitive values; e.g., DataInput.readFloat(). Similar methods are specified for writing single primitive values. When reading or writing arrays of primitive values, calling those methods for each array element can be inefficient. Therefore, this class also provides methods that read and write arrays of primitive values in one call.

For efficiency, some software systems read and write primitive values using the native byte order of the hardware. That byte order may be BIG_ENDIAN or LITTLE_ENDIAN, and may be specified when constructing a data file.

Version:
2006.01.14
Author:
Dave Hale, Colorado School of Mines

Nested Class Summary
static class DataFile.ByteOrder
          The byte order of the file.
 
Constructor Summary
DataFile(java.io.File file, java.lang.String mode)
          Constructs a data file with specified file and access mode.
DataFile(java.io.File file, java.lang.String mode, DataFile.ByteOrder order)
          Constructs a data file with specified file, access mode, and byte order.
DataFile(java.lang.String name, java.lang.String mode)
          Constructs a data file with specified name and access mode.
DataFile(java.lang.String name, java.lang.String mode, DataFile.ByteOrder order)
          Constructs a data file with specified name, access mode, and byte order.
 
Method Summary
 void close()
          Closes this data file, releasing any associated system resources.
 DataFile.ByteOrder getByteOrder()
          Gets the byte order for this data file.
 java.nio.channels.FileChannel getChannel()
          Gets the file channel for this data file.
 java.io.FileDescriptor getFD()
          Gets the file descripter for this data file.
 long getFilePointer()
          Gets the file pointer (byte offset) for this file.
 long length()
          Returns the length of this file.
static DataFile.ByteOrder nativeByteOrder()
          Returns the native byte order for the platform with this file.
 int read()
          Reads a byte value from this file.
 int read(byte[] b)
          Reads up to b.length bytes from this file.
 int read(byte[] b, int off, int len)
          Reads up to len bytes from this file.
 boolean readBoolean()
           
 byte readByte()
           
 void readBytes(byte[] v)
          Reads byte elements into a specified array.
 void readBytes(byte[][] v)
          Reads byte elements into a specified array.
 void readBytes(byte[][][] v)
          Reads byte elements into a specified array.
 void readBytes(byte[] v, int k, int n)
          Reads byte elements into a specified array.
 char readChar()
           
 void readChars(char[] v)
          Reads char elements into a specified array.
 void readChars(char[][] v)
          Reads char elements into a specified array.
 void readChars(char[][][] v)
          Reads char elements into a specified array.
 void readChars(char[] v, int k, int n)
          Reads char elements into a specified array.
 double readDouble()
           
 void readDoubles(double[] v)
          Reads double elements into a specified array.
 void readDoubles(double[][] v)
          Reads double elements into a specified array.
 void readDoubles(double[][][] v)
          Reads double elements into a specified array.
 void readDoubles(double[] v, int k, int n)
          Reads double elements into a specified array.
 float readFloat()
           
 void readFloats(float[] v)
          Reads float elements into a specified array.
 void readFloats(float[][] v)
          Reads float elements into a specified array.
 void readFloats(float[][][] v)
          Reads float elements into a specified array.
 void readFloats(float[] v, int k, int n)
          Reads float elements into a specified array.
 void readFully(byte[] b)
           
 void readFully(byte[] b, int off, int len)
           
 int readInt()
           
 void readInts(int[] v)
          Reads int elements into a specified array.
 void readInts(int[][] v)
          Reads int elements into a specified array.
 void readInts(int[][][] v)
          Reads int elements into a specified array.
 void readInts(int[] v, int k, int n)
          Reads int elements into a specified array.
 java.lang.String readLine()
           
 long readLong()
           
 void readLongs(long[] v)
          Reads long elements into a specified array.
 void readLongs(long[][] v)
          Reads long elements into a specified array.
 void readLongs(long[][][] v)
          Reads long elements into a specified array.
 void readLongs(long[] v, int k, int n)
          Reads long elements into a specified array.
 short readShort()
           
 void readShorts(short[] v)
          Reads short elements into a specified array.
 void readShorts(short[][] v)
          Reads short elements into a specified array.
 void readShorts(short[][][] v)
          Reads short elements into a specified array.
 void readShorts(short[] v, int k, int n)
          Reads short elements into a specified array.
 int readUnsignedByte()
           
 int readUnsignedShort()
           
 java.lang.String readUTF()
           
 void seek(long off)
          Sets the file pointer (byte offset) for this file.
 void setLength(long newLength)
          Sets the length of this file.
 int skipBytes(int n)
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 void writeBoolean(boolean v)
           
 void writeByte(int v)
           
 void writeBytes(byte[] v)
          Writes byte elements from a specified array.
 void writeBytes(byte[][] v)
          Writes byte elements from a specified array.
 void writeBytes(byte[][][] v)
          Writes byte elements from a specified array.
 void writeBytes(byte[] v, int k, int n)
          Writes byte elements from a specified array.
 void writeBytes(java.lang.String s)
           
 void writeChar(int v)
           
 void writeChars(char[] v)
          Writes char elements from a specified array.
 void writeChars(char[][] v)
          Writes char elements from a specified array.
 void writeChars(char[][][] v)
          Writes char elements from a specified array.
 void writeChars(char[] v, int k, int n)
          Writes char elements from a specified array.
 void writeChars(java.lang.String s)
           
 void writeDouble(double v)
           
 void writeDoubles(double[] v)
          Writes double elements from a specified array.
 void writeDoubles(double[][] v)
          Writes double elements from a specified array.
 void writeDoubles(double[][][] v)
          Writes double elements from a specified array.
 void writeDoubles(double[] v, int k, int n)
          Writes double elements from a specified array.
 void writeFloat(float v)
           
 void writeFloats(float[] v)
          Writes float elements from a specified array.
 void writeFloats(float[][] v)
          Writes float elements from a specified array.
 void writeFloats(float[][][] v)
          Writes float elements from a specified array.
 void writeFloats(float[] v, int k, int n)
          Writes float elements from a specified array.
 void writeInt(int v)
           
 void writeInts(int[] v)
          Writes int elements from a specified array.
 void writeInts(int[][] v)
          Writes int elements from a specified array.
 void writeInts(int[][][] v)
          Writes int elements from a specified array.
 void writeInts(int[] v, int k, int n)
          Writes int elements from a specified array.
 void writeLong(long v)
           
 void writeLongs(long[] v)
          Writes long elements from a specified array.
 void writeLongs(long[][] v)
          Writes long elements from a specified array.
 void writeLongs(long[][][] v)
          Writes long elements from a specified array.
 void writeLongs(long[] v, int k, int n)
          Writes long elements from a specified array.
 void writeShort(int v)
           
 void writeShorts(short[] v)
          Writes shorts elements from a specified array.
 void writeShorts(short[][] v)
          Writes short elements from a specified array.
 void writeShorts(short[][][] v)
          Writes short elements from a specified array.
 void writeShorts(short[] v, int k, int n)
          Writes short elements from a specified array.
 void writeUTF(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataFile

public DataFile(java.lang.String name,
                java.lang.String mode)
         throws java.io.FileNotFoundException
Constructs a data file with specified name and access mode.

Parameters:
name - the file name.
mode - the access mode; "r", "rw", "rws", or "rwd".
Throws:
java.io.FileNotFoundException

DataFile

public DataFile(java.io.File file,
                java.lang.String mode)
         throws java.io.FileNotFoundException
Constructs a data file with specified file and access mode.

Parameters:
file - the file.
mode - the access mode; "r", "rw", "rws", or "rwd".
Throws:
java.io.FileNotFoundException

DataFile

public DataFile(java.lang.String name,
                java.lang.String mode,
                DataFile.ByteOrder order)
         throws java.io.FileNotFoundException
Constructs a data file with specified name, access mode, and byte order.

Parameters:
name - the file name.
mode - the access mode; "r", "rw", "rws", or "rwd".
order - the byte order.
Throws:
java.io.FileNotFoundException

DataFile

public DataFile(java.io.File file,
                java.lang.String mode,
                DataFile.ByteOrder order)
         throws java.io.FileNotFoundException
Constructs a data file with specified file, access mode, and byte order.

Parameters:
file - the file.
mode - the access mode; "r", "rw", "rws", or "rwd".
order - the byte order.
Throws:
java.io.FileNotFoundException
Method Detail

nativeByteOrder

public static DataFile.ByteOrder nativeByteOrder()
Returns the native byte order for the platform with this file.

Returns:
the byte order.

getFD

public final java.io.FileDescriptor getFD()
                                   throws java.io.IOException
Gets the file descripter for this data file.

Returns:
the file descriptor.
Throws:
java.io.IOException

getChannel

public final java.nio.channels.FileChannel getChannel()
Gets the file channel for this data file.

Returns:
the file channel.

getByteOrder

public DataFile.ByteOrder getByteOrder()
Gets the byte order for this data file.

Returns:
the byte order.

read

public int read()
         throws java.io.IOException
Reads a byte value from this file. The returned value will be in the range 0 to 255.

Returns:
the byte value.
Throws:
java.io.IOException

read

public int read(byte[] b)
         throws java.io.IOException
Reads up to b.length bytes from this file.

Parameters:
b - array into which to read bytes.
Returns:
the number of bytes read; -1 if end of file.
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Reads up to len bytes from this file.

Parameters:
b - array into which to read bytes.
off - array index of first byte to read.
len - the number of bytes to read.
Returns:
the number of bytes read; -1 if end of file.
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
Specified by:
readFully in interface java.io.DataInput
Throws:
java.io.IOException

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(int b)
           throws java.io.IOException
Specified by:
write in interface java.io.DataOutput
Throws:
java.io.IOException

write

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

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Specified by:
write in interface java.io.DataOutput
Throws:
java.io.IOException

getFilePointer

public long getFilePointer()
                    throws java.io.IOException
Gets the file pointer (byte offset) for this file. The next read or write begins at this offset.

Returns:
the file pointer.
Throws:
java.io.IOException

seek

public void seek(long off)
          throws java.io.IOException
Sets the file pointer (byte offset) for this file. The next read or or write begins at this offset.

The offset may be set beyond the end of the file. Setting the offset beyond the end of the file does not increase the file length. The file length increases only by writing beyond the end of the file.

Parameters:
off - the file pointer, the offset in bytes from the beginning of the file.
Throws:
java.io.IOException

length

public long length()
            throws java.io.IOException
Returns the length of this file.

Returns:
the file length, in bytes.
Throws:
java.io.IOException

setLength

public void setLength(long newLength)
               throws java.io.IOException
Sets the length of this file. If the current file length exceeds the specified new length, then the file will be truncated. In this case, if the file pointer exceeds the new length, then that pointer will equal to the new length when this methods returns.

If the current file length is less than the specified new length, then this file will extended. The content of the extended portion is undefined.

Parameters:
newLength - the new length.
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes this data file, releasing any associated system resources.

Specified by:
close in interface java.io.Closeable
Throws:
java.io.IOException

readBoolean

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

readByte

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

readUnsignedByte

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

readShort

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

readUnsignedShort

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

readChar

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

readInt

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

readLong

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

readFloat

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

readDouble

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

readLine

public final java.lang.String readLine()
                                throws java.io.IOException
Specified by:
readLine in interface java.io.DataInput
Throws:
java.io.IOException

readUTF

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

writeBoolean

public void writeBoolean(boolean v)
                  throws java.io.IOException
Specified by:
writeBoolean in interface java.io.DataOutput
Throws:
java.io.IOException

writeByte

public void writeByte(int v)
               throws java.io.IOException
Specified by:
writeByte in interface java.io.DataOutput
Throws:
java.io.IOException

writeShort

public void writeShort(int v)
                throws java.io.IOException
Specified by:
writeShort in interface java.io.DataOutput
Throws:
java.io.IOException

writeChar

public void writeChar(int v)
               throws java.io.IOException
Specified by:
writeChar in interface java.io.DataOutput
Throws:
java.io.IOException

writeInt

public void writeInt(int v)
              throws java.io.IOException
Specified by:
writeInt in interface java.io.DataOutput
Throws:
java.io.IOException

writeLong

public void writeLong(long v)
               throws java.io.IOException
Specified by:
writeLong in interface java.io.DataOutput
Throws:
java.io.IOException

writeFloat

public void writeFloat(float v)
                throws java.io.IOException
Specified by:
writeFloat in interface java.io.DataOutput
Throws:
java.io.IOException

writeDouble

public void writeDouble(double v)
                 throws java.io.IOException
Specified by:
writeDouble 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

writeChars

public void writeChars(java.lang.String s)
                throws java.io.IOException
Specified by:
writeChars 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

readBytes

public void readBytes(byte[] v,
                      int k,
                      int n)
               throws java.io.IOException
Reads byte elements into a specified array.

Parameters:
v - the array.
k - the index of the first element to read.
n - the number of elements to read.
Throws:
java.io.IOException

readBytes

public void readBytes(byte[] v)
               throws java.io.IOException
Reads byte elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readBytes

public void readBytes(byte[][] v)
               throws java.io.IOException
Reads byte elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readBytes

public void readBytes(byte[][][] v)
               throws java.io.IOException
Reads byte elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readChars

public void readChars(char[] v,
                      int k,
                      int n)
               throws java.io.IOException
Reads char elements into a specified array.

Parameters:
v - the array.
k - the index of the first element to read.
n - the number of elements to read.
Throws:
java.io.IOException

readChars

public void readChars(char[] v)
               throws java.io.IOException
Reads char elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readChars

public void readChars(char[][] v)
               throws java.io.IOException
Reads char elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readChars

public void readChars(char[][][] v)
               throws java.io.IOException
Reads char elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readShorts

public void readShorts(short[] v,
                       int k,
                       int n)
                throws java.io.IOException
Reads short elements into a specified array.

Parameters:
v - the array.
k - the index of the first element to read.
n - the number of elements to read.
Throws:
java.io.IOException

readShorts

public void readShorts(short[] v)
                throws java.io.IOException
Reads short elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readShorts

public void readShorts(short[][] v)
                throws java.io.IOException
Reads short elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readShorts

public void readShorts(short[][][] v)
                throws java.io.IOException
Reads short elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readInts

public void readInts(int[] v,
                     int k,
                     int n)
              throws java.io.IOException
Reads int elements into a specified array.

Parameters:
v - the array.
k - the index of the first element to read.
n - the number of elements to read.
Throws:
java.io.IOException

readInts

public void readInts(int[] v)
              throws java.io.IOException
Reads int elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readInts

public void readInts(int[][] v)
              throws java.io.IOException
Reads int elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readInts

public void readInts(int[][][] v)
              throws java.io.IOException
Reads int elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readLongs

public void readLongs(long[] v,
                      int k,
                      int n)
               throws java.io.IOException
Reads long elements into a specified array.

Parameters:
v - the array.
k - the index of the first element to read.
n - the number of elements to read.
Throws:
java.io.IOException

readLongs

public void readLongs(long[] v)
               throws java.io.IOException
Reads long elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readLongs

public void readLongs(long[][] v)
               throws java.io.IOException
Reads long elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readLongs

public void readLongs(long[][][] v)
               throws java.io.IOException
Reads long elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readFloats

public void readFloats(float[] v,
                       int k,
                       int n)
                throws java.io.IOException
Reads float elements into a specified array.

Parameters:
v - the array.
k - the index of the first element to read.
n - the number of elements to read.
Throws:
java.io.IOException

readFloats

public void readFloats(float[] v)
                throws java.io.IOException
Reads float elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readFloats

public void readFloats(float[][] v)
                throws java.io.IOException
Reads float elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readFloats

public void readFloats(float[][][] v)
                throws java.io.IOException
Reads float elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readDoubles

public void readDoubles(double[] v,
                        int k,
                        int n)
                 throws java.io.IOException
Reads double elements into a specified array.

Parameters:
v - the array.
k - the index of the first element to read.
n - the number of elements to read.
Throws:
java.io.IOException

readDoubles

public void readDoubles(double[] v)
                 throws java.io.IOException
Reads double elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readDoubles

public void readDoubles(double[][] v)
                 throws java.io.IOException
Reads double elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

readDoubles

public void readDoubles(double[][][] v)
                 throws java.io.IOException
Reads double elements into a specified array. The array length equals the number of elements to read.

Parameters:
v - the array.
Throws:
java.io.IOException

writeBytes

public void writeBytes(byte[] v,
                       int k,
                       int n)
                throws java.io.IOException
Writes byte elements from a specified array.

Parameters:
v - the array.
k - the index of the first element to write.
n - the number of elements to write.
Throws:
java.io.IOException

writeBytes

public void writeBytes(byte[] v)
                throws java.io.IOException
Writes byte elements from a specified array. The array length equals the number of elements to write.

Parameters:
v - the array.
Throws:
java.io.IOException

writeBytes

public void writeBytes(byte[][] v)
                throws java.io.IOException
Writes byte elements from a specified array.

Parameters:
v - the array.
Throws:
java.io.IOException

writeBytes

public void writeBytes(byte[][][] v)
                throws java.io.IOException
Writes byte elements from a specified array.

Parameters:
v - the array.
Throws:
java.io.IOException

writeChars

public void writeChars(char[] v,
                       int k,
                       int n)
                throws java.io.IOException
Writes char elements from a specified array.

Parameters:
v - the array.
k - the index of the first element to write.
n - the number of elements to write.
Throws:
java.io.IOException

writeChars

public void writeChars(char[] v)
                throws java.io.IOException
Writes char elements from a specified array. The array length equals the number of elements to write.

Parameters:
v - the array.
Throws:
java.io.IOException

writeChars

public void writeChars(char[][] v)
                throws java.io.IOException
Writes char elements from a specified array.

Parameters:
v - the array.
Throws:
java.io.IOException

writeChars

public void writeChars(char[][][] v)
                throws java.io.IOException
Writes char elements from a specified array.

Parameters:
v - the array.
Throws:
java.io.IOException

writeShorts

public void writeShorts(short[] v,
                        int k,
                        int n)
                 throws java.io.IOException
Writes short elements from a specified array.

Parameters:
v - the array.
k - the index of the first element to write.
n - the number of elements to write.
Throws:
java.io.IOException

writeShorts

public void writeShorts(short[] v)
                 throws java.io.IOException
Writes shorts elements from a specified array. The array length equals the number of elements to write.

Parameters:
v - the array.
Throws:
java.io.IOException

writeShorts

public void writeShorts(short[][] v)
                 throws java.io.IOException
Writes short elements from a specified array.

Parameters:
v - the array.
Throws:
java.io.IOException

writeShorts

public void writeShorts(short[][][] v)
                 throws java.io.IOException
Writes short elements from a specified array.

Parameters:
v - the array.
Throws:
java.io.IOException

writeInts

public void writeInts(int[] v,
                      int k,
                      int n)
               throws java.io.IOException
Writes int elements from a specified array.

Parameters:
v - the array.
k - the index of the first element to write.
n - the number of elements to write.
Throws:
java.io.IOException

writeInts

public void writeInts(int[] v)
               throws java.io.IOException
Writes int elements from a specified array. The array length equals the number of elements to write.

Parameters:
v - the array.
Throws:
java.io.IOException

writeInts

public void writeInts(int[][] v)
               throws java.io.IOException
Writes int elements from a specified array.

Parameters:
v - the array.
Throws:
java.io.IOException

writeInts

public void writeInts(int[][][] v)
               throws java.io.IOException
Writes int elements from a specified array.

Parameters:
v - the array.
Throws:
java.io.IOException

writeLongs

public void writeLongs(long[] v,
                       int k,
                       int n)
                throws java.io.IOException
Writes long elements from a specified array.

Parameters:
v - the array.
k - the index of the first element to write.
n - the number of elements to write.
Throws:
java.io.IOException

writeLongs

public void writeLongs(long[] v)
                throws java.io.IOException
Writes long elements from a specified array. The array length equals the number of elements to write.

Parameters:
v - the array.
Throws:
java.io.IOException

writeLongs

public void writeLongs(long[][] v)
                throws java.io.IOException
Writes long elements from a specified array.

Parameters:
v - the array.
Throws:
java.io.IOException

writeLongs

public void writeLongs(long[][][] v)
                throws java.io.IOException
Writes long elements from a specified array.

Parameters:
v - the array.
Throws:
java.io.IOException

writeFloats

public void writeFloats(float[] v,
                        int k,
                        int n)
                 throws java.io.IOException
Writes float elements from a specified array.

Parameters:
v - the array.
k - the index of the first element to write.
n - the number of elements to write.
Throws:
java.io.IOException

writeFloats

public void writeFloats(float[] v)
                 throws java.io.IOException
Writes float elements from a specified array. The array length equals the number of elements to write.

Parameters:
v - the array.
Throws:
java.io.IOException

writeFloats

public void writeFloats(float[][] v)
                 throws java.io.IOException
Writes float elements from a specified array.

Parameters:
v - the array.
Throws:
java.io.IOException

writeFloats

public void writeFloats(float[][][] v)
                 throws java.io.IOException
Writes float elements from a specified array.

Parameters:
v - the array.
Throws:
java.io.IOException

writeDoubles

public void writeDoubles(double[] v,
                         int k,
                         int n)
                  throws java.io.IOException
Writes double elements from a specified array.

Parameters:
v - the array.
k - the index of the first element to write.
n - the number of elements to write.
Throws:
java.io.IOException

writeDoubles

public void writeDoubles(double[] v)
                  throws java.io.IOException
Writes double elements from a specified array. The array length equals the number of elements to write.

Parameters:
v - the array.
Throws:
java.io.IOException

writeDoubles

public void writeDoubles(double[][] v)
                  throws java.io.IOException
Writes double elements from a specified array.

Parameters:
v - the array.
Throws:
java.io.IOException

writeDoubles

public void writeDoubles(double[][][] v)
                  throws java.io.IOException
Writes double elements from a specified array.

Parameters:
v - the array.
Throws:
java.io.IOException