|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
org.apache.derby.client.am.ClobLocatorOutputStream
public class ClobLocatorOutputStream
An OutputStream that will use an locator to write
bytes to the Clob value on the server.
Closing a ByteArrayInputStream has no effect. The methods in
this class can be called after the stream has been closed without
generating an IOException.
This OutputStream implementation is pretty basic. No
buffering of data is done. Hence, for efficieny #write(byte[])
should be used instead of #write(int).
| Field Summary | |
|---|---|
private Clob |
clob
The Clob to be accessed. |
private Connection |
connection
Connection used to read Clob from server. |
private long |
currentPos
Current position in the underlying Clob. |
| Constructor Summary | |
|---|---|
ClobLocatorOutputStream(Connection connection,
Clob clob,
long pos)
Create an OutputStream for writing to the
Clob value represented by the given locator based
Clob object. |
|
| Method Summary | |
|---|---|
void |
flush()
|
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
private void |
writeBytes(byte[] b)
Write the byte[] to the Clob value on
the server; starting from the current position of this stream. |
| Methods inherited from class java.io.OutputStream |
|---|
close |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final Connection connection
private final Clob clob
private long currentPos
| Constructor Detail |
|---|
public ClobLocatorOutputStream(Connection connection,
Clob clob,
long pos)
throws SqlException
OutputStream for writing to the
Clob value represented by the given locator based
Clob object.
connection - connection to be used to write to the
Clob value on the serverclob - Clob object that contains locator for
the Clob value on the server.pos - the position in the CLOB value at which
to start writing; the first position is 1
SqlException| Method Detail |
|---|
public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionThis method writes one byte at a time to the server. For more
efficient writing, use #write(byte[]).
public void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionOutputStream.write(byte[])
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionOutputStream.write(byte[], int, int)public void flush()
flush in interface java.io.Flushableflush in class java.io.OutputStreamOutputStream.flush()
private void writeBytes(byte[] b)
throws java.io.IOException
byte[] to the Clob value on
the server; starting from the current position of this stream.
b - The byte array containing the bytes to be written
java.io.IOException - Wrapped SqlException if writing
to server fails.
|
Built on Wed 2013-06-12 15:21:56+0000, from revision ??? | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||