jhplot.math.io
Class LERandomAccessFile

java.lang.Object
  extended by jhplot.math.io.LERandomAccessFile
All Implemented Interfaces:
DataInput, DataOutput

public class LERandomAccessFile
extends Object
implements DataInput, DataOutput

This class was designed on the base of Roedy Green LEDataInputStream Thanks to Roedy Green, Canadian Mind Products mailto:roedy@mindprod.com http://mindprod.com


Constructor Summary
LERandomAccessFile(File f, String rw)
           
LERandomAccessFile(String f, String rw)
          constructors
 
Method Summary
 void close()
           
 FileDescriptor getFD()
           
 long getFilePointer()
           
 long length()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 boolean readBoolean()
           
 byte readByte()
           
 char readChar()
          like RandomAcessFile.readChar except little endian.
 double readDouble()
          like RandomAcessFile.readDouble except little endian.
 float readFloat()
          like RandomAcessFile.readFloat except little endian.
 void readFully(byte[] b)
           
 void readFully(byte[] b, int off, int len)
           
 int readInt()
          like RandomAcessFile.readInt except little endian.
 String readLine()
           
 long readLong()
          like RandomAcessFile.readLong except little endian.
 short readShort()
          like RandomAcessFile.readShort except little endian.
 int readUnsignedByte()
           
 int readUnsignedShort()
          like RandomAcessFile.readUnsignedShort except little endian.
 String readUTF()
           
 void seek(long pos)
           
 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(String s)
           
 void writeChar(int v)
          like RandomAcessFile.writeChar.
 void writeChars(String s)
          like RandomAcessFile.writeChars, has to flip each char.
 void writeDouble(double v)
          like RandomAcessFile.writeDouble.
 void writeFloat(float v)
          like RandomAcessFile.writeFloat.
 void writeInt(int v)
          like RandomAcessFile.writeInt.
 void writeLong(long v)
          like RandomAcessFile.writeLong.
 void writeShort(int v)
          like RandomAcessFile.writeShort.
 void writeUTF(String str)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LERandomAccessFile

public LERandomAccessFile(String f,
                          String rw)
                   throws IOException
constructors

Throws:
IOException

LERandomAccessFile

public LERandomAccessFile(File f,
                          String rw)
                   throws IOException
Throws:
IOException
Method Detail

readShort

public final short readShort()
                      throws IOException
like RandomAcessFile.readShort except little endian.

Specified by:
readShort in interface DataInput
Throws:
IOException

readUnsignedShort

public final int readUnsignedShort()
                            throws IOException
like RandomAcessFile.readUnsignedShort except little endian. Note, returns int even though it reads a short.

Specified by:
readUnsignedShort in interface DataInput
Throws:
IOException

readChar

public final char readChar()
                    throws IOException
like RandomAcessFile.readChar except little endian.

Specified by:
readChar in interface DataInput
Throws:
IOException

readInt

public final int readInt()
                  throws IOException
like RandomAcessFile.readInt except little endian.

Specified by:
readInt in interface DataInput
Throws:
IOException

readLong

public final long readLong()
                    throws IOException
like RandomAcessFile.readLong except little endian.

Specified by:
readLong in interface DataInput
Throws:
IOException

readFloat

public final float readFloat()
                      throws IOException
like RandomAcessFile.readFloat except little endian.

Specified by:
readFloat in interface DataInput
Throws:
IOException

readDouble

public final double readDouble()
                        throws IOException
like RandomAcessFile.readDouble except little endian.

Specified by:
readDouble in interface DataInput
Throws:
IOException

writeShort

public final void writeShort(int v)
                      throws IOException
like RandomAcessFile.writeShort. also acts as a writeUnsignedShort

Specified by:
writeShort in interface DataOutput
Throws:
IOException

writeChar

public final void writeChar(int v)
                     throws IOException
like RandomAcessFile.writeChar. Note the parm is an int even though this as a writeChar

Specified by:
writeChar in interface DataOutput
Throws:
IOException

writeInt

public final void writeInt(int v)
                    throws IOException
like RandomAcessFile.writeInt.

Specified by:
writeInt in interface DataOutput
Throws:
IOException

writeLong

public final void writeLong(long v)
                     throws IOException
like RandomAcessFile.writeLong.

Specified by:
writeLong in interface DataOutput
Throws:
IOException

writeFloat

public final void writeFloat(float v)
                      throws IOException
like RandomAcessFile.writeFloat.

Specified by:
writeFloat in interface DataOutput
Throws:
IOException

writeDouble

public final void writeDouble(double v)
                       throws IOException
like RandomAcessFile.writeDouble.

Specified by:
writeDouble in interface DataOutput
Throws:
IOException

writeChars

public final void writeChars(String s)
                      throws IOException
like RandomAcessFile.writeChars, has to flip each char.

Specified by:
writeChars in interface DataOutput
Throws:
IOException

getFD

public final FileDescriptor getFD()
                           throws IOException
Throws:
IOException

getFilePointer

public final long getFilePointer()
                          throws IOException
Throws:
IOException

length

public final long length()
                  throws IOException
Throws:
IOException

read

public final int read(byte[] b,
                      int off,
                      int len)
               throws IOException
Throws:
IOException

read

public final int read(byte[] b)
               throws IOException
Throws:
IOException

read

public final int read()
               throws IOException
Throws:
IOException

readFully

public final void readFully(byte[] b)
                     throws IOException
Specified by:
readFully in interface DataInput
Throws:
IOException

readFully

public final void readFully(byte[] b,
                            int off,
                            int len)
                     throws IOException
Specified by:
readFully in interface DataInput
Throws:
IOException

skipBytes

public final int skipBytes(int n)
                    throws IOException
Specified by:
skipBytes in interface DataInput
Throws:
IOException

readBoolean

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

readByte

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

readUnsignedByte

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

readLine

public final String readLine()
                      throws IOException
Specified by:
readLine in interface DataInput
Throws:
IOException

readUTF

public final String readUTF()
                     throws IOException
Specified by:
readUTF in interface DataInput
Throws:
IOException

seek

public final void seek(long pos)
                throws IOException
Throws:
IOException

write

public final void write(int b)
                 throws IOException
Specified by:
write in interface DataOutput
Throws:
IOException

write

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

writeBoolean

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

writeByte

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

writeBytes

public final void writeBytes(String s)
                      throws IOException
Specified by:
writeBytes in interface DataOutput
Throws:
IOException

writeUTF

public final void writeUTF(String str)
                    throws IOException
Specified by:
writeUTF in interface DataOutput
Throws:
IOException

write

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

close

public final void close()
                 throws IOException
Throws:
IOException


jHepWork 3.1 ©