org.apache.derby.impl.jdbc
Class ClobUtf8Writer

java.lang.Object
  extended by java.io.Writer
      extended by org.apache.derby.impl.jdbc.ClobUtf8Writer
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

final class ClobUtf8Writer
extends java.io.Writer

Writer implementation for Clob.


Field Summary
private  boolean closed
           
private  TemporaryClob control
           
private  long pos
           
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
ClobUtf8Writer(TemporaryClob control, long pos)
          Constructor.
 
Method Summary
 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.
 
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 value
pos - 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 interface java.io.Flushable
Specified by:
flush in class java.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 or flush() invocations will cause an IOException to be thrown. Closing a previously closed stream has no effect.

Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.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 class java.io.Writer
Parameters:
cbuf - array of characters
off - offset into cbuf from which to start writing characters
len - number of characters to write
Throws:
java.io.IOException - if an I/O error occurs

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.