|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.vfs.RandomAccessStream
com.caucho.vfs.FileRandomAccessStream
public class FileRandomAccessStream
Reads from a file in a random-access fashion.
| Constructor Summary | |
|---|---|
FileRandomAccessStream(java.io.RandomAccessFile file)
|
|
| Method Summary | |
|---|---|
void |
closeImpl()
Closes the stream. |
long |
getFilePointer()
Returns the current position of the file pointer. |
java.io.InputStream |
getInputStream()
Returns an InputStream for this stream. |
long |
getLength()
Returns the length. |
java.io.OutputStream |
getOutputStream()
Returns an OutputStream for this stream. |
java.io.RandomAccessFile |
getRandomAccessFile()
|
boolean |
lock(boolean shared,
boolean block)
Lock the shared advisory lock. |
int |
read()
Read a byte from the file, advancing the pointer. |
int |
read(byte[] buffer,
int offset,
int length)
Reads a block starting from the current file pointer. |
int |
read(char[] buffer,
int offset,
int length)
Reads a block starting from the current file pointer. |
int |
read(long fileOffset,
byte[] buffer,
int offset,
int length)
Reads a block from a given location. |
boolean |
seek(long position)
Seeks to the given position in the file. |
java.lang.String |
toString()
|
boolean |
unlock()
Unlock the advisory lock. |
void |
write(byte[] buffer,
int offset,
int length)
Writes a block starting from the current file pointer. |
void |
write(int b)
Write a byte to the file, advancing the pointer. |
void |
write(long fileOffset,
byte[] buffer,
int offset,
int length)
Writes a block from a given location. |
| Methods inherited from class com.caucho.vfs.RandomAccessStream |
|---|
allocate, close, free, getUseCount, isOpen |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FileRandomAccessStream(java.io.RandomAccessFile file)
| Method Detail |
|---|
public java.io.RandomAccessFile getRandomAccessFile()
public long getLength()
throws java.io.IOException
getLength in class RandomAccessStreamjava.io.IOException
public int read(byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in class RandomAccessStreamjava.io.IOException
public int read(char[] buffer,
int offset,
int length)
throws java.io.IOException
read in class RandomAccessStreamjava.io.IOException
public int read(long fileOffset,
byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in class RandomAccessStreamjava.io.IOException
public void write(byte[] buffer,
int offset,
int length)
throws java.io.IOException
write in class RandomAccessStreamjava.io.IOException
public void write(long fileOffset,
byte[] buffer,
int offset,
int length)
throws java.io.IOException
write in class RandomAccessStreamjava.io.IOExceptionpublic boolean seek(long position)
seek in class RandomAccessStream
public java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in class RandomAccessStreamjava.io.IOException
public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in class RandomAccessStreamjava.io.IOException
public int read()
throws java.io.IOException
read in class RandomAccessStreamjava.io.IOException
public void write(int b)
throws java.io.IOException
write in class RandomAccessStreamjava.io.IOException
public long getFilePointer()
throws java.io.IOException
getFilePointer in class RandomAccessStreamjava.io.IOException
public void closeImpl()
throws java.io.IOException
closeImpl in class RandomAccessStreamjava.io.IOException
public boolean lock(boolean shared,
boolean block)
LockableStream
lock in interface LockableStreamlock in class RandomAccessStreampublic boolean unlock()
LockableStream
unlock in interface LockableStreamunlock in class RandomAccessStreampublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||