Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.imagero.uio
Class OffsetRandomAccessFile  view OffsetRandomAccessFile download OffsetRandomAccessFile.java

java.lang.Object
  extended byjava.io.RandomAccessFile
      extended bycom.imagero.uio.OffsetRandomAccessFile
All Implemented Interfaces:
java.io.DataInput, java.io.DataOutput

public class OffsetRandomAccessFile
extends java.io.RandomAccessFile

OffsetRandomAccessFile.java
Usefull for reading EXIF files
However this class has bad performance, bacause the data is unbuffered.


Field Summary
protected  long length
           
protected  long offset
           
 
Fields inherited from class java.io.RandomAccessFile
 
Constructor Summary
OffsetRandomAccessFile(java.io.File file, java.lang.String mode, long offset)
           
OffsetRandomAccessFile(java.io.File file, java.lang.String mode, long offset, long length)
           
OffsetRandomAccessFile(java.lang.String name, java.lang.String mode, long offset)
           
OffsetRandomAccessFile(java.lang.String name, java.lang.String mode, long offset, long length)
           
 
Method Summary
 long getFilePointer()
          This method returns the current offset in the file at which the next read or write will occur
 long length()
          This method returns the length of the file in bytes
 int read()
          This method reads a single byte of data from the file and returns it as an integer.
 void seek(long pos)
          This method sets the current file position to the specified offset from the beginning of the file.
 int skip(int n)
           
 
Methods inherited from class java.io.RandomAccessFile
close, getChannel, getFD, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, setLength, skipBytes, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

offset

protected long offset

length

protected long length
Constructor Detail

OffsetRandomAccessFile

public OffsetRandomAccessFile(java.io.File file,
                              java.lang.String mode,
                              long offset)
                       throws java.io.IOException

OffsetRandomAccessFile

public OffsetRandomAccessFile(java.io.File file,
                              java.lang.String mode,
                              long offset,
                              long length)
                       throws java.io.IOException

OffsetRandomAccessFile

public OffsetRandomAccessFile(java.lang.String name,
                              java.lang.String mode,
                              long offset)
                       throws java.io.IOException

OffsetRandomAccessFile

public OffsetRandomAccessFile(java.lang.String name,
                              java.lang.String mode,
                              long offset,
                              long length)
                       throws java.io.IOException
Method Detail

seek

public void seek(long pos)
          throws java.io.IOException
Description copied from class: java.io.RandomAccessFile
This method sets the current file position to the specified offset from the beginning of the file. Note that some operating systems will allow the file pointer to be set past the current end of the file.


read

public int read()
         throws java.io.IOException
Description copied from class: java.io.RandomAccessFile
This method reads a single byte of data from the file and returns it as an integer.


length

public long length()
            throws java.io.IOException
Description copied from class: java.io.RandomAccessFile
This method returns the length of the file in bytes


getFilePointer

public long getFilePointer()
                    throws java.io.IOException
Description copied from class: java.io.RandomAccessFile
This method returns the current offset in the file at which the next read or write will occur


skip

public int skip(int n)
         throws java.io.IOException