com.caucho.vfs
Class TempReadStream
java.lang.Object
com.caucho.vfs.StreamImpl
com.caucho.vfs.TempReadStream
public class TempReadStream
- extends StreamImpl
Method Summary |
boolean |
canRead()
Returns true if this is a read stream. |
void |
close()
Closes the stream. |
int |
getAvailable()
Returns the number of bytes available without blocking. |
void |
init(TempBuffer cursor)
|
int |
read(byte[] buf,
int offset,
int length)
Reads the next chunk from the stream. |
void |
setFreeWhenDone(boolean free)
|
java.lang.String |
toString()
|
Methods inherited from class com.caucho.vfs.StreamImpl |
canWrite, clearWrite, closeWrite, flush, flushBuffer, flushToDisk, getAttribute, getAttributeNames, getFlushOnNewline, getNewline, getPath, getReadBuffer, getReadPosition, hasSkip, isClosed, isEof, isMmapEnabled, isSendfileEnabled, readNonBlock, readTimeout, removeAttribute, seekEnd, seekStart, setAttribute, setPath, setWriteEncoding, skip, write, write, writeMmap, writeSendfile |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TempReadStream
public TempReadStream(TempBuffer cursor)
TempReadStream
public TempReadStream()
init
public void init(TempBuffer cursor)
setFreeWhenDone
public void setFreeWhenDone(boolean free)
canRead
public boolean canRead()
- Description copied from class:
StreamImpl
- Returns true if this is a read stream.
- Overrides:
canRead
in class StreamImpl
read
public int read(byte[] buf,
int offset,
int length)
throws java.io.IOException
- Description copied from class:
StreamImpl
- Reads the next chunk from the stream.
- Overrides:
read
in class StreamImpl
- Parameters:
buf
- byte array receiving the data.offset
- starting offset into the array.length
- number of bytes to read.
- Returns:
- the number of bytes read or -1 on end of file.
- Throws:
java.io.IOException
getAvailable
public int getAvailable()
throws java.io.IOException
- Description copied from class:
StreamImpl
- Returns the number of bytes available without blocking. Depending on
the stream, this may return less than the actual bytes, but will always
return a number > 0 if there is any data available.
- Overrides:
getAvailable
in class StreamImpl
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Description copied from class:
StreamImpl
- Closes the stream.
- Overrides:
close
in class StreamImpl
- Throws:
java.io.IOException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object