|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
org.knime.core.data.container.BlockableOutputStream
final class BlockableOutputStream
Output stream that allows to set block marks. It will scan the byte array on
incoming write(byte[])
or write(byte[], int, int)
invocations and escape the bytes if necessary.
This class is used to mark the end of a
DataCell
in order avoid stream corruption
when a DataCell
reads more (or less) than it
has written.
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 | |
---|---|
BlockableOutputStream(OutputStream outStream)
Constructor that simply memorizes the stream to write to. |
Method Summary | |
---|---|
void |
close()
Delegates to output stream. |
void |
endBlock()
Writes a terminate character to the underlying stream. |
void |
flush()
Delegates to output stream. |
void |
write(byte[] b)
Calls write(byte[], int, int) . |
void |
write(byte[] b,
int off,
int len)
Parses the byte[] argument, escapes the bytes if necessary and delegates escaped byte array to underlying stream. |
void |
write(int b)
Checks if the byte to be written needs to be escaped and does so if necessary. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
BlockableOutputStream(OutputStream outStream)
outStream
- to write to, never null
Method Detail |
---|
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write(byte[], int, int)
.
write
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void endBlock() throws IOException
IOException
- if the write fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |