Package net.sourceforge.jtds.util
Class BlobBuffer.BlobOutputStream
java.lang.Object
java.io.OutputStream
net.sourceforge.jtds.util.BlobBuffer.BlobOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
- Enclosing class:
BlobBuffer
Implements an
OutputStream
for BLOB data.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBlobOutputStream
(long pos) Costructs an OutputStream object over the BLOB buffer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the output stream.protected void
finalize()
Ensures underlying BLOB file can be closed even if user does not close this stream.void
write
(byte[] bytes, int offset, int len) Write bytes to the BLOB buffer.void
write
(int b) Write a byte to the BLOB buffer.Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
Field Details
-
writePtr
private int writePtr -
open
private boolean open
-
-
Constructor Details
-
BlobOutputStream
BlobOutputStream(long pos) throws IOException Costructs an OutputStream object over the BLOB buffer.- Parameters:
pos
- the starting position (from 0)- Throws:
IOException
- if an I/O error occurs
-
-
Method Details
-
finalize
Ensures underlying BLOB file can be closed even if user does not close this stream. -
write
Write a byte to the BLOB buffer.- Specified by:
write
in classOutputStream
- Parameters:
b
- the byte value to write- Throws:
IOException
- if an I/O error occurs
-
write
Write bytes to the BLOB buffer.- Overrides:
write
in classOutputStream
- Parameters:
bytes
- the byte array value to writeoffset
- the start position in the byte arraylen
- the number of bytes to write- Throws:
IOException
- if an I/O error occurs
-
close
Close the output stream.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
- if an I/O error occurs
-