|
||||||||||
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.BlockModeOutputStream
public class BlockModeOutputStream
In the case of a file being sent with file-structure to a record-oriented host, there exists the question of what criteria the host should use to divide the file into records which can be processed locally. If this division is necessary, an FTP implementation should use the end-of-line sequence, CRLF for ASCII, or NewLine (0x25) for EBCDIC text files, as the delimiter. If an FTP implementation adopts this technique, it must be prepared to reverse the transformation if the file is retrieved with file-structure.
Field Summary |
---|
Fields inherited from interface net.sf.hermesftp.streams.BlockModeConstants |
---|
DESC_CODE_EOF, DESC_CODE_EOR, DESC_CODE_ERR, DESC_CODE_REST |
Constructor Summary | |
---|---|
BlockModeOutputStream(java.io.OutputStream os)
Constructor. |
|
BlockModeOutputStream(java.io.OutputStream os,
int blockSize)
Constructor. |
Method Summary | |
---|---|
void |
close()
|
void |
finalizeRecord(boolean eof)
Flushes the last dataset. |
void |
flush()
Flushes any buffered record data. |
void |
write(int b)
|
void |
writeRecord(byte[] record,
boolean eof)
Writes a complete record and marks the transfer optionally with EOF. |
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 BlockModeOutputStream(java.io.OutputStream os)
os
- The nested output stream.public BlockModeOutputStream(java.io.OutputStream os, int blockSize)
os
- The output stream.blockSize
- The blocksize.Method Detail |
---|
public void writeRecord(byte[] record, boolean eof) throws java.io.IOException
writeRecord
in interface RecordWriteSupport
record
- The data to be transmitted.eof
- True, if the transfer is complete.
java.io.IOException
- If writing the data fails or the file was previously finalized.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
- When writing 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 |