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