|
||||||||||
| 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. |
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 IOException
IOException| Method Detail |
|---|
public long getFilePointer()
throws IOException
RandomAccessContent
getFilePointer in interface RandomAccessContentgetFilePointer in class RandomAccessFileIOException - if an I/O error occurs.
public void seek(long pos)
throws IOException
RandomAccessContentRandomAccessContent.getInputStream() you have to reget the InputStream after
calling RandomAccessContent.seek(long)
seek in interface RandomAccessContentseek in class RandomAccessFilepos - the offset position, measured in bytes from the
beginning of the file, at which to set the file
pointer.
IOException - if pos is less than
0 or if an I/O error occurs.
public int skipBytes(int n)
throws IOException
skipBytes in interface DataInputskipBytes in class RandomAccessFileIOException
public long length()
throws IOException
RandomAccessContent
length in interface RandomAccessContentlength in class RandomAccessFileIOException - if an I/O error occurs.
public void setLength(long newLength)
throws IOException
setLength in class RandomAccessFileIOException
public InputStream getInputStream()
throws IOException
RandomAccessContentRandomAccessContent.seek(long) you have to reget the InputStream
getInputStream in interface RandomAccessContentIOException - if an I/O error occurs.
public void close()
throws IOException
RandomAccessContentIf this file has an associated channel then the channel is closed as well.
close in interface Closeableclose in interface RandomAccessContentclose in class RandomAccessFileIOException - if an I/O error occurs.
public final int read(byte[] b)
throws IOException
read in class RandomAccessFileIOExceptionRandomAccessFile.read(byte[])
public final int read()
throws IOException
read in class RandomAccessFileIOExceptionRandomAccessFile.read()
public int read(byte[] b,
int off,
int len)
throws IOException
read in class RandomAccessFileIOException
public final void write(int b)
throws IOException
write in interface DataOutputwrite in class RandomAccessFileIOExceptionRandomAccessFile.write(int)
public final void write(byte[] b)
throws IOException
write in interface DataOutputwrite in class RandomAccessFileIOExceptionRandomAccessFile.write(byte[])
public void write(byte[] b,
int off,
int len)
throws IOException
write in interface DataOutputwrite in class RandomAccessFileIOExceptionRandomAccessFile.write(byte[],int,int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||