3.1.2: 2012-07-31

net.sf.basedb.core.migrate
Class ByteArrayWriter

java.lang.Object
  extended by net.sf.basedb.core.migrate.AbstractResultWriter
      extended by net.sf.basedb.core.migrate.ByteArrayWriter
All Implemented Interfaces:
ResultWriter

public class ByteArrayWriter
extends AbstractResultWriter

Generic writer implementation that writes byte-array values from a result set. An escape map should be given at construction time that maps byte-values (0-255) to an escape char[] sequence. If no escape sequence is given the original byte is written as is using Writer.write(int). This writer use ResultSet.getBytes(int) to read data from the result set.

Since:
3.1
Author:
Nicklas
Last modified
$Date$

Field Summary
private  char[][] ESCAPE
           
 
Fields inherited from class net.sf.basedb.core.migrate.AbstractResultWriter
index, NULL_ESCAPE, rs, writer
 
Constructor Summary
ByteArrayWriter(ResultSet rs, int index, Writer writer, char[] nullEscape, char[][] byteEscape)
           
 
Method Summary
 void write()
          Write the current data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ESCAPE

private final char[][] ESCAPE
Constructor Detail

ByteArrayWriter

public ByteArrayWriter(ResultSet rs,
                       int index,
                       Writer writer,
                       char[] nullEscape,
                       char[][] byteEscape)
Method Detail

write

public void write()
           throws SQLException,
                  IOException
Description copied from interface: ResultWriter
Write the current data.

Throws:
SQLException
IOException

3.1.2: 2012-07-31