org.sqlite.io
Class BlobOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.sqlite.io.BlobOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class BlobOutputStream
extends java.io.OutputStream


Constructor Summary
BlobOutputStream(Closeable owner, Blob blob, long pos)
          create BLOB output stream.
 
Method Summary
 void close()
          Closes this stream.
 void write(byte[] b)
          Writes b.length bytes from the specified byte array to this output stream.
 void write(byte[] b, int off, int len)
          Writes len bytes from the specified byte array starting at offset off to this output stream.
 void write(int b)
          Writes the specified byte to this output stream.
 
Methods inherited from class java.io.OutputStream
flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlobOutputStream

public BlobOutputStream(Closeable owner,
                        Blob blob,
                        long pos)
                 throws java.sql.SQLException
create BLOB output stream.

Parameters:
owner - the owner object
blob - sqlite3_blob wrapper object
pos - the position in the BLOB object at which to start writing; the first position is 1
Throws:
java.sql.SQLException - if pos is less than 1
Method Detail

close

public void close()
Closes this stream.

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

write

public void write(byte[] b)
           throws java.io.IOException
Writes b.length bytes from the specified byte array to this output stream.

Overrides:
write in class java.io.OutputStream
Parameters:
b - the data.
Throws:
java.io.IOException
See Also:
write(byte[], int, int)

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Writes len bytes from the specified byte array starting at offset off to this output stream.

Overrides:
write in class java.io.OutputStream
Parameters:
b - the data.
off - the start offset in the data.
len - the number of bytes to write.
Throws:
java.io.IOException

write

public void write(int b)
           throws java.io.IOException
Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream.

Specified by:
write in class java.io.OutputStream
Parameters:
b - the byte.
Throws:
java.io.IOException
See Also:
write(byte[], int, int)