|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.RandomAccessFile
org.apache.commons.vfs.RACRandomAccessFile
public class RACRandomAccessFile
Encapsulates a RandomAccessContent
instance, allowing it to be used
as a RandomAccessFile
instance.
Field Summary | |
---|---|
protected byte[] |
singleByteBuf
|
Constructor Summary | |
---|---|
RACRandomAccessFile(RandomAccessContent rac)
|
Method Summary | |
---|---|
void |
close()
Closes this random access file stream and releases any system resources associated with the stream. |
long |
getFilePointer()
Returns the current offset in this file. |
java.io.InputStream |
getInputStream()
Get the input stream. |
long |
length()
Returns the length of this file. |
int |
read()
|
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int len)
|
void |
seek(long pos)
Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs. |
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 |
---|
protected final byte[] singleByteBuf
Constructor Detail |
---|
public RACRandomAccessFile(RandomAccessContent rac) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public long getFilePointer() throws java.io.IOException
RandomAccessContent
getFilePointer
in interface RandomAccessContent
getFilePointer
in class java.io.RandomAccessFile
java.io.IOException
- if an I/O error occurs.public void seek(long pos) throws java.io.IOException
RandomAccessContent
RandomAccessContent.getInputStream()
you have to reget the InputStream after
calling RandomAccessContent.seek(long)
seek
in interface RandomAccessContent
seek
in class java.io.RandomAccessFile
pos
- the offset position, measured in bytes from the
beginning of the file, at which to set the file
pointer.
java.io.IOException
- if pos
is less than
0
or if an I/O error occurs.public int skipBytes(int n) throws java.io.IOException
skipBytes
in interface java.io.DataInput
skipBytes
in class java.io.RandomAccessFile
java.io.IOException
public long length() throws java.io.IOException
RandomAccessContent
length
in interface RandomAccessContent
length
in class java.io.RandomAccessFile
java.io.IOException
- if an I/O error occurs.public void setLength(long newLength) throws java.io.IOException
setLength
in class java.io.RandomAccessFile
java.io.IOException
public java.io.InputStream getInputStream() throws java.io.IOException
RandomAccessContent
RandomAccessContent.seek(long)
you have to reget the InputStream
getInputStream
in interface RandomAccessContent
java.io.IOException
- if an I/O error occurs.public void close() throws java.io.IOException
RandomAccessContent
If this file has an associated channel then the channel is closed as well.
close
in interface java.io.Closeable
close
in interface RandomAccessContent
close
in class java.io.RandomAccessFile
java.io.IOException
- if an I/O error occurs.public final int read(byte[] b) throws java.io.IOException
read
in class java.io.RandomAccessFile
java.io.IOException
RandomAccessFile.read(byte[])
public final int read() throws java.io.IOException
read
in class java.io.RandomAccessFile
java.io.IOException
RandomAccessFile.read()
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.RandomAccessFile
java.io.IOException
public final void write(int b) throws java.io.IOException
write
in interface java.io.DataOutput
write
in class java.io.RandomAccessFile
java.io.IOException
RandomAccessFile.write(int)
public final void write(byte[] b) throws java.io.IOException
write
in interface java.io.DataOutput
write
in class java.io.RandomAccessFile
java.io.IOException
RandomAccessFile.write(byte[])
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in interface java.io.DataOutput
write
in class java.io.RandomAccessFile
java.io.IOException
RandomAccessFile.write(byte[],int,int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |