org.apache.commons.vfs2
Class RACRandomAccessFile

java.lang.Object
  extended by java.io.RandomAccessFile
      extended by org.apache.commons.vfs2.RACRandomAccessFile
All Implemented Interfaces:
Closeable, DataInput, DataOutput, RandomAccessContent

public class RACRandomAccessFile
extends RandomAccessFile
implements RandomAccessContent

Encapsulates a RandomAccessContent instance, allowing it to be used as a RandomAccessFile instance.

Version:
1.1, $LastChangedRevision: 1163 $, $LastChangedDate: 2006-12-13 03:18:57 +0000 (Qua, 13 Dez 2006) $
Author:
Elifarley Callado Coelho Cruz

Field Summary
protected  byte[] singleByteBuf
           
 
Constructor Summary
RACRandomAccessFile(RandomAccessContent rac)
           
 
Method Summary
 void close()
           
 long getFilePointer()
           
 InputStream getInputStream()
           
 long length()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 void seek(long pos)
           
 void setLength(long newLength)
           
 int skipBytes(int n)
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.io.RandomAccessFile
getChannel, getFD, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, 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
 
Methods inherited from interface java.io.DataOutput
writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF
 

Field Detail

singleByteBuf

protected final byte[] singleByteBuf
Constructor Detail

RACRandomAccessFile

public RACRandomAccessFile(RandomAccessContent rac)
                    throws IOException
Throws:
IOException
Method Detail

getFilePointer

public long getFilePointer()
                    throws IOException
Specified by:
getFilePointer in interface RandomAccessContent
Overrides:
getFilePointer in class RandomAccessFile
Throws:
IOException

seek

public void seek(long pos)
          throws IOException
Specified by:
seek in interface RandomAccessContent
Overrides:
seek in class RandomAccessFile
Throws:
IOException

skipBytes

public int skipBytes(int n)
              throws IOException
Specified by:
skipBytes in interface DataInput
Overrides:
skipBytes in class RandomAccessFile
Throws:
IOException

length

public long length()
            throws IOException
Specified by:
length in interface RandomAccessContent
Overrides:
length in class RandomAccessFile
Throws:
IOException

setLength

public void setLength(long newLength)
               throws IOException
Overrides:
setLength in class RandomAccessFile
Throws:
IOException

getInputStream

public InputStream getInputStream()
                           throws IOException
Specified by:
getInputStream in interface RandomAccessContent
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in interface RandomAccessContent
Overrides:
close in class RandomAccessFile
Throws:
IOException

read

public final int read(byte[] b)
               throws IOException
Overrides:
read in class RandomAccessFile
Throws:
IOException
See Also:
RandomAccessFile.read(byte[])

read

public final int read()
               throws IOException
Overrides:
read in class RandomAccessFile
Throws:
IOException
See Also:
RandomAccessFile.read()

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class RandomAccessFile
Throws:
IOException

write

public final void write(int b)
                 throws IOException
Specified by:
write in interface DataOutput
Overrides:
write in class RandomAccessFile
Throws:
IOException
See Also:
RandomAccessFile.write(int)

write

public final void write(byte[] b)
                 throws IOException
Specified by:
write in interface DataOutput
Overrides:
write in class RandomAccessFile
Throws:
IOException
See Also:
RandomAccessFile.write(byte[])

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Specified by:
write in interface DataOutput
Overrides:
write in class RandomAccessFile
Throws:
IOException
See Also:
RandomAccessFile.write(byte[],int,int)


Copyright © 2002–2015 WSO2. All rights reserved.