com.caucho.vfs
Class MemoryStream

java.lang.Object
  |
  +--com.caucho.vfs.StreamImpl
        |
        +--com.caucho.vfs.MemoryStream

public class MemoryStream
extends StreamImpl


Fields inherited from class com.caucho.vfs.StreamImpl
nullPath, path
 
Constructor Summary
MemoryStream()
           
 
Method Summary
 boolean canWrite()
          A memory stream is writable.
 void destroy()
           
 int getLength()
           
 Path getPath()
          Returns the Path associated with the stream.
 ReadStream openRead()
           
 void write(byte[] buf, int offset, int length, boolean isEnd)
          Writes a buffer to the underlying stream.
 void writeToStream(java.io.OutputStream os)
           
 
Methods inherited from class com.caucho.vfs.StreamImpl
canRead, clearWrite, close, flush, getAttribute, getAttributeNames, getAvailable, getFlushOnNewline, getNewline, getReadPosition, hasSkip, read, removeAttribute, setAttribute, setPath, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryStream

public MemoryStream()
Method Detail

getPath

public Path getPath()
Description copied from class: StreamImpl
Returns the Path associated with the stream.
Overrides:
getPath in class StreamImpl

canWrite

public boolean canWrite()
A memory stream is writable.
Overrides:
canWrite in class StreamImpl

write

public void write(byte[] buf,
                  int offset,
                  int length,
                  boolean isEnd)
           throws java.io.IOException
Writes a buffer to the underlying stream.
Overrides:
write in class StreamImpl
Parameters:
buffer - the byte array to write.
offset - the offset into the byte array.
length - the number of bytes to write.
isEnd - true when the write is flushing a close.

writeToStream

public void writeToStream(java.io.OutputStream os)
                   throws java.io.IOException

getLength

public int getLength()

openRead

public ReadStream openRead()
                    throws java.io.IOException

destroy

public void destroy()