com.caucho.db.blob
Class BlobOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.caucho.db.blob.BlobOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class BlobOutputStream
extends java.io.OutputStream


Constructor Summary
BlobOutputStream(BlockStore store, byte[] inode, int inodeOffset)
          Creates a blob output stream.
BlobOutputStream(DbTransaction xa, BlockStore store, byte[] inode, int inodeOffset)
          Creates a blob output stream.
 
Method Summary
 void close()
          Completes the stream.
 void init(BlockStore store, byte[] inode, int inodeOffset)
          Initialize the output stream.
 void write(byte[] buffer, int offset, int length)
          Writes a buffer.
 void write(int v)
          Writes a byte.
 void writeFromStream(java.io.InputStream is)
           
 
Methods inherited from class java.io.OutputStream
flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlobOutputStream

public BlobOutputStream(DbTransaction xa,
                        BlockStore store,
                        byte[] inode,
                        int inodeOffset)
Creates a blob output stream.

Parameters:
store - the output store

BlobOutputStream

public BlobOutputStream(BlockStore store,
                        byte[] inode,
                        int inodeOffset)
Creates a blob output stream.

Parameters:
store - the output store
Method Detail

init

public void init(BlockStore store,
                 byte[] inode,
                 int inodeOffset)
Initialize the output stream.


write

public void write(int v)
           throws java.io.IOException
Writes a byte.

Specified by:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(byte[] buffer,
                  int offset,
                  int length)
           throws java.io.IOException
Writes a buffer.

Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

writeFromStream

public void writeFromStream(java.io.InputStream is)
                     throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Completes the stream.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream
Throws:
java.io.IOException