|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.knime.core.data.container.DCObjectOutputVersion2
class DCObjectOutputVersion2
Object writing the binary stream of a Buffer.
This class provides functionality to write DataCell objects in
both possibles modes: Using a custom DataCellSerializer (for
DataCell class that offer it) as well as plain (and slow) java
serialization.
The general stream layout is as follows: Objects of this class write
to a BlockableOutputStream in order to write DataCells to
an isolated sandbox. Each DataCell entry is preceded by one or more control
bytes, which are written by the associated Buffer. The Buffer
also decides when to close a block. DataCell which need to be java
serialized are written a freshly created ObjectOutputStream (for
each cell a new stream).
| Field Summary |
|---|
| Fields inherited from interface org.knime.core.data.container.KNIMEStreamConstants |
|---|
BYTE_ROW_SEPARATOR, BYTE_TYPE_MISSING, BYTE_TYPE_SERIALIZATION, BYTE_TYPE_START, DUMMY_ROW_KEY, TC_ESCAPE, TC_TERMINATE |
| Constructor Summary | |
|---|---|
DCObjectOutputVersion2(OutputStream out,
Buffer ownerBuffer)
Setups a new output stream. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the underlying streams. |
(package private) void |
endBlock()
Marks the end of the block. |
(package private) void |
endRow()
Writes the row end identifier. |
void |
flush()
Flushes the underlying streams. |
(package private) void |
writeBlobAddress(BlobDataCell.BlobAddress address)
Writes a given blob address to the stream. |
(package private) void |
writeControlByte(int controlByte)
Writes the argument byte. |
(package private) void |
writeDataCellPerJavaSerialization(DataCell cell)
Writes a cell using java serialization. |
(package private) void |
writeDataCellPerKNIMESerializer(DataCellSerializer<DataCell> serializer,
DataCell cell)
Writes a data cell using the serializer. |
(package private) void |
writeRowKey(RowKey key)
Writes a row key by writing the underlying string to the stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DCObjectOutputVersion2(OutputStream out,
Buffer ownerBuffer)
out - The stream to write to (the file)ownerBuffer - the associated buffer.| Method Detail |
|---|
void writeDataCellPerKNIMESerializer(DataCellSerializer<DataCell> serializer,
DataCell cell)
throws IOException
serializer - The factory being used to write the cell.cell - The cell to be written.
IOException - If that fails.DataCellSerializer.serialize(DataCell, DataCellDataOutput)
void writeDataCellPerJavaSerialization(DataCell cell)
throws IOException
ObjectOutputStream for this single cell.
cell - The cell to write.
IOException - If any exception occur.
void writeBlobAddress(BlobDataCell.BlobAddress address)
throws IOException
address - to write out.
IOException - if that fails
void writeRowKey(RowKey key)
throws IOException
key - Key to write
IOException - In case of stream corruption.
void writeControlByte(int controlByte)
throws IOException
controlByte - The byte to write.
IOException - In case of stream corruption.
void endBlock()
throws IOException
IOException - In case of stream corruption.
void endRow()
throws IOException
IOException - In case of stream corruption.
public void close()
throws IOException
IOException - If the stream closing causes IO problems.
public void flush()
throws IOException
IOException - If the stream flush causes IO problems.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||