com.caucho.vfs
Class TempOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.caucho.vfs.TempOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable
Direct Known Subclasses:
TempDigestOutputStream

public class TempOutputStream
extends java.io.OutputStream


Constructor Summary
TempOutputStream()
           
 
Method Summary
 void clear()
          clear without removing
 void close()
           
 void destroy()
          Clean up the temp stream.
 void flush()
           
 TempBuffer getHead()
          Returns the head buffer.
 java.io.InputStream getInputStream()
          Opens a read stream to the buffer.
 int getLength()
          Returns the total length of the buffer's bytes
 byte[] getTail()
           
 java.io.InputStream openInputStream()
          Opens a read stream to the buffer.
 java.io.InputStream openInputStreamNoFree()
          Opens a read stream to the buffer.
 ReadStream openRead()
          Opens a read stream to the buffer.
 void readAll(int position, byte[] buffer, int offset, int length)
           
 void readAll(int position, char[] buffer, int offset, int length)
           
 byte[] toByteArray()
           
 void write(byte[] buffer)
           
 void write(byte[] buf, int offset, int length)
           
 void write(int ch)
           
 void writeToStream(java.io.OutputStream os)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TempOutputStream

public TempOutputStream()
Method Detail

getTail

public byte[] getTail()

write

public void write(int ch)
Specified by:
write in class java.io.OutputStream

write

public void write(byte[] buf,
                  int offset,
                  int length)
Overrides:
write in class java.io.OutputStream

write

public void write(byte[] buffer)
Overrides:
write in class java.io.OutputStream

flush

public void flush()
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream

close

public void close()
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream

openRead

public ReadStream openRead()
                    throws java.io.IOException
Opens a read stream to the buffer.

Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Opens a read stream to the buffer.

Throws:
java.io.IOException

openInputStream

public java.io.InputStream openInputStream()
                                    throws java.io.IOException
Opens a read stream to the buffer.

Throws:
java.io.IOException

openInputStreamNoFree

public java.io.InputStream openInputStreamNoFree()
                                          throws java.io.IOException
Opens a read stream to the buffer.

Throws:
java.io.IOException

getHead

public TempBuffer getHead()
Returns the head buffer.


clear

public void clear()
clear without removing


writeToStream

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

getLength

public int getLength()
Returns the total length of the buffer's bytes


toByteArray

public byte[] toByteArray()

readAll

public void readAll(int position,
                    char[] buffer,
                    int offset,
                    int length)

readAll

public void readAll(int position,
                    byte[] buffer,
                    int offset,
                    int length)

destroy

public void destroy()
Clean up the temp stream.