class ClobLocatorWriter
extends java.io.Writer
Writer
that will use an locator to write the
Clob value into the server.
This Writer
implementation is pretty basic. No
buffering of data is done. Hence, for efficiency #write(char[])
should be used instead of #write(int)
.
Modifier and Type | Field and Description |
---|---|
private ClientClob |
clob
The Clob to be accessed.
|
private ClientConnection |
connection
Connection used to read Clob from server.
|
private long |
currentPos
Current position in the underlying Clob.
|
private boolean |
isClosed
Stores the information to whether this Writer has been
closed or not.
|
Constructor and Description |
---|
ClobLocatorWriter(ClientConnection connection,
ClientClob clob,
long pos)
Create a
Writer for writing to the
Clob value represented by the given locator based
Clob object. |
Modifier and Type | Method and Description |
---|---|
private void |
checkClosed()
Check to see if this
Writer is closed. |
void |
close() |
void |
flush() |
void |
write(char[] c) |
void |
write(char[] c,
int off,
int len) |
void |
write(int c) |
private void |
writeCharacters(char[] c,
int off,
int len)
Write the
char[] to the Clob value on
the server; starting from the current position of this stream. |
private final ClientConnection connection
private final ClientClob clob
private long currentPos
private boolean isClosed
ClobLocatorWriter(ClientConnection connection, ClientClob clob, long pos) throws SqlException
Writer
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 1SqlException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Writer
java.io.IOException
Writer.close()
private void checkClosed() throws java.io.IOException
Writer
is closed. If it
is closed throw an IOException
that states that
the stream is closed.java.io.IOException
- if isClosed = true.public void write(int c) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
This method writes one Character at a time to the server. For more
efficient writing, use #write(char[]).
public void write(char[] c) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
Writer.write(char[])
public void flush()
flush
in interface java.io.Flushable
flush
in class java.io.Writer
Writer.flush()
public void write(char[] c, int off, int len) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
Writer.write(char[], int, int)
private void writeCharacters(char[] c, int off, int len) throws java.io.IOException
char[]
to the Clob
value on
the server; starting from the current position of this stream.c
- The character array containing the chars to be writtenjava.io.IOException
- Wrapped SqlException if writing
to server fails.Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.