|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream net.sf.hermesftp.streams.RecordInputStream
public class RecordInputStream
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 | |
---|---|
RecordInputStream(java.io.InputStream is)
Constructor. |
|
RecordInputStream(java.io.InputStream is,
byte[] eorMarker)
Constructor. |
Method Summary | |
---|---|
void |
close()
|
int |
read()
|
byte[] |
readRecord()
Reads a complete record, excluding the end marker. |
Methods inherited from class java.io.InputStream |
---|
available, mark, markSupported, read, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RecordInputStream(java.io.InputStream is)
is
- The input stream.public RecordInputStream(java.io.InputStream is, byte[] eorMarker)
is
- The input stream.eorMarker
- The byte sequence the EOR marker is translated to (e.g. line break).Method Detail |
---|
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public byte[] readRecord() throws java.io.IOException
readRecord
in interface RecordReadSupport
java.io.IOException
- If something goes wrong.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.InputStream
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |