|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream net.sf.hermesftp.streams.RecordOutputStream
public class RecordOutputStream
In a record structured file EOR and EOF will each be indicated by a two-byte control code. The first byte of the control code will be all ones, the escape character. The second byte will have the low order bit on and zeros elsewhere for EOR and the second low order bit on for EOF; that is, the byte will have value 1 for EOR and value 2 for EOF. EOR and EOF may be indicated together on the last byte transmitted by turning both low order bits on (i.e., the value 3). If a byte of all ones was intended to be sent as data, it should be repeated in the second byte of the control code.
Constructor Summary | |
---|---|
RecordOutputStream(java.io.OutputStream os)
Constructor. |
Method Summary | |
---|---|
void |
close()
Before the stream is closed and EOF marker is set. |
void |
finalizeRecord(boolean eof)
Flushes the buffer and sets an EOR / EOF marker. |
void |
flush()
A flush ends the current record. |
void |
write(int b)
|
void |
writeRecord(byte[] record,
boolean eof)
Writes a whole record and sets the end marker. |
Methods inherited from class java.io.OutputStream |
---|
write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RecordOutputStream(java.io.OutputStream os)
os
- The output stream.Method Detail |
---|
public void writeRecord(byte[] record, boolean eof) throws java.io.IOException
writeRecord
in interface RecordWriteSupport
record
- The record to transmit.eof
- End of file is reached.
java.io.IOException
- Thrown if somethings goes wrong.public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in interface RecordWriteSupport
flush
in class java.io.OutputStream
java.io.IOException
- Thrown if IO fails.public void finalizeRecord(boolean eof) throws java.io.IOException
eof
- True if end of file.
java.io.IOException
- thrown if writing to stream fails.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.OutputStream
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |