|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.vfs.StreamImpl
com.caucho.vfs.FileReadStream
public class FileReadStream
Stream encapsulating FileInputStream
| Field Summary |
|---|
| Fields inherited from class com.caucho.vfs.StreamImpl |
|---|
_nullPath, _path |
| Constructor Summary | |
|---|---|
FileReadStream()
Create a new FileReadStream. |
|
FileReadStream(java.io.FileInputStream is)
Create a new FileReadStream based on the java.io.* stream. |
|
FileReadStream(java.io.FileInputStream is,
Path path)
Create a new FileReadStream based on the java.io.* stream. |
|
| Method Summary | |
|---|---|
boolean |
canRead()
Returns true if there's an associated file. |
void |
close()
Closes the underlying stream. |
int |
getAvailable()
Returns the number of bytes available for reading. |
boolean |
hasSkip()
Returns true if there's an associated file. |
void |
init(java.io.FileInputStream is)
Initializes a VfsStream with an input/output stream pair. |
boolean |
lock(boolean shared,
boolean block)
Lock the shared advisory lock. |
int |
read(byte[] buf,
int offset,
int length)
Reads bytes from the file. |
void |
seekStart(long offset)
Seeks based on the start. |
long |
skip(long n)
Skips bytes in the file. |
boolean |
unlock()
Unlock the advisory lock. |
| Methods inherited from class com.caucho.vfs.StreamImpl |
|---|
canWrite, clearWrite, closeWrite, flush, flushBuffer, flushToDisk, getAttribute, getAttributeNames, getFlushOnNewline, getNewline, getPath, getReadBuffer, getReadPosition, isClosed, isEof, readNonBlock, readTimeout, removeAttribute, seekEnd, setAttribute, setPath, setWriteEncoding, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileReadStream()
public FileReadStream(java.io.FileInputStream is)
is - the underlying input stream.
public FileReadStream(java.io.FileInputStream is,
Path path)
is - the underlying input stream.path - the associated Path.| Method Detail |
|---|
public void init(java.io.FileInputStream is)
is - the underlying InputStream.os - the underlying OutputStream.public boolean hasSkip()
hasSkip in class StreamImpl
public long skip(long n)
throws java.io.IOException
skip in class StreamImpln - the number of bytes to skip
java.io.IOException
public void seekStart(long offset)
throws java.io.IOException
seekStart in class StreamImpljava.io.IOExceptionpublic boolean canRead()
canRead in class StreamImpl
public int read(byte[] buf,
int offset,
int length)
throws java.io.IOException
read in class StreamImplbuf - a byte array receiving the data.offset - starting index to receive data.length - number of bytes to read.
java.io.IOException
public int getAvailable()
throws java.io.IOException
getAvailable in class StreamImpljava.io.IOException
public void close()
throws java.io.IOException
close in class StreamImpljava.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 | |||||||||