public class BlobOutputStream
extends java.io.OutputStream
| Modifier and Type | Field and Description |
|---|---|
private byte[] |
buf
Buffer.
|
private int |
bufferPosition
Position within the buffer.
|
(package private) static int |
DEFAULT_MAX_BUFFER_SIZE |
private LargeObject |
lo
The parent LargeObject.
|
private ResourceLock |
lock |
private int |
maxBufferSize
Size of the buffer (default 1K).
|
| Constructor and Description |
|---|
BlobOutputStream(LargeObject lo)
Create an OutputStream to a large object.
|
BlobOutputStream(LargeObject lo,
int bufferSize)
Create an OutputStream to a large object.
|
| Modifier and Type | Method and Description |
|---|---|
private LargeObject |
checkClosed() |
void |
close() |
void |
flush()
Flushes this output stream and forces any buffered output bytes to be written out.
|
private byte[] |
growBuffer(int extraBytes)
Grows an internal buffer to ensure the extra bytes fit in the buffer.
|
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
static final int DEFAULT_MAX_BUFFER_SIZE
private LargeObject lo
private final ResourceLock lock
private byte[] buf
private final int maxBufferSize
private int bufferPosition
public BlobOutputStream(LargeObject lo)
lo - LargeObjectpublic BlobOutputStream(LargeObject lo, int bufferSize)
lo - LargeObjectbufferSize - The size of the buffer for single-byte writesprivate byte[] growBuffer(int extraBytes)
extraBytes - the number of extra bytes that should fit in the bufferpublic void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush is that calling it is an indication that, if any bytes
previously written have been buffered by the implementation of the output stream, such bytes
should immediately be written to their intended destination.flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOException - if an I/O error occurs.public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionprivate LargeObject checkClosed() throws java.io.IOException
java.io.IOException