|
||||||||||
| 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 Notice: If you use RandomAccessContent.seek(long) you have to reget the InputStream |
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 RandomAccessContentgetFilePointer in class java.io.RandomAccessFilejava.io.IOException - if an I/O error occurs.
public void seek(long pos)
throws java.io.IOException
RandomAccessContentRandomAccessContent.getInputStream() you have to reget the InputStream after calling RandomAccessContent.seek(long)
seek in interface RandomAccessContentseek in class java.io.RandomAccessFilepos - 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.DataInputskipBytes in class java.io.RandomAccessFilejava.io.IOException
public long length()
throws java.io.IOException
RandomAccessContent
length in interface RandomAccessContentlength in class java.io.RandomAccessFilejava.io.IOException - if an I/O error occurs.
public void setLength(long newLength)
throws java.io.IOException
setLength in class java.io.RandomAccessFilejava.io.IOException
public java.io.InputStream getInputStream()
throws java.io.IOException
RandomAccessContentRandomAccessContent.seek(long) you have to reget the InputStream
getInputStream in interface RandomAccessContentjava.io.IOException
public void close()
throws java.io.IOException
RandomAccessContentIf this file has an associated channel then the channel is closed as well.
close in interface java.io.Closeableclose in interface RandomAccessContentclose in class java.io.RandomAccessFilejava.io.IOException - if an I/O error occurs.
public final int read(byte[] b)
throws java.io.IOException
read in class java.io.RandomAccessFilejava.io.IOExceptionRandomAccessFile.read(byte[])
public final int read()
throws java.io.IOException
read in class java.io.RandomAccessFilejava.io.IOExceptionRandomAccessFile.read()
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.RandomAccessFilejava.io.IOException
public final void write(int b)
throws java.io.IOException
write in interface java.io.DataOutputwrite in class java.io.RandomAccessFilejava.io.IOExceptionRandomAccessFile.write(int)
public final void write(byte[] b)
throws java.io.IOException
write in interface java.io.DataOutputwrite in class java.io.RandomAccessFilejava.io.IOExceptionRandomAccessFile.write(byte[])
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in interface java.io.DataOutputwrite in class java.io.RandomAccessFilejava.io.IOExceptionRandomAccessFile.write(byte[],int,int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||