Package org.apache.derby.impl.jdbc
Class ClobUtf8Writer
- java.lang.Object
-
- java.io.Writer
-
- org.apache.derby.impl.jdbc.ClobUtf8Writer
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.Appendable
,java.lang.AutoCloseable
final class ClobUtf8Writer extends java.io.Writer
Writer implementation forClob
.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
closed
private TemporaryClob
control
private long
pos
-
Constructor Summary
Constructors Constructor Description ClobUtf8Writer(TemporaryClob control, long pos)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the stream.void
flush()
Flushes the stream.void
write(char[] cbuf, int off, int len)
Writes a portion of an array of characters to the CLOB value.
-
-
-
Field Detail
-
control
private TemporaryClob control
-
pos
private long pos
-
closed
private boolean closed
-
-
Constructor Detail
-
ClobUtf8Writer
ClobUtf8Writer(TemporaryClob control, long pos)
Constructor.- Parameters:
control
- worker object for the CLOB valuepos
- initial byte position in the CLOB value
-
-
Method Detail
-
flush
public void flush() throws java.io.IOException
Flushes the stream.Flushing the stream after
close()
has been called will cause an exception to be thrown.Implementation note: In the current implementation, this is a no-op. Flushing is left to the underlying stream(s). Note that when programming against/with this class, always follow good practice and call
flush
.- Specified by:
flush
in interfacejava.io.Flushable
- Specified by:
flush
in classjava.io.Writer
- Throws:
java.io.IOException
- if the stream has been closed
-
close
public void close()
Closes the stream.Once the stream has been closed, further
write
orflush()
invocations will cause anIOException
to be thrown. Closing a previously closed stream has no effect.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in classjava.io.Writer
-
write
public void write(char[] cbuf, int off, int len) throws java.io.IOException
Writes a portion of an array of characters to the CLOB value.- Specified by:
write
in classjava.io.Writer
- Parameters:
cbuf
- array of charactersoff
- offset intocbuf
from which to start writing characterslen
- number of characters to write- Throws:
java.io.IOException
- if an I/O error occurs
-
-