Package org.yamcs.tctm
Class FixedPacketInputStream
java.lang.Object
org.yamcs.tctm.FixedPacketInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable,PacketInputStream
This input stream reads packets of a configurable fixed packet size.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidinit(InputStream inputStream, YConfiguration args) Called each time an input stream is opened to initialize the objectbyte[]read the next packet - blocking if necessary until all the data is available.
-
Field Details
-
dataInputStream
-
-
Constructor Details
-
FixedPacketInputStream
public FixedPacketInputStream()
-
-
Method Details
-
init
Description copied from interface:PacketInputStreamCalled each time an input stream is opened to initialize the object- Specified by:
initin interfacePacketInputStream
-
readPacket
Description copied from interface:PacketInputStreamread the next packet - blocking if necessary until all the data is available.- Specified by:
readPacketin interfacePacketInputStream- Returns:
- the next packet read from the input stream.
- Throws:
EOFException- if this input stream reaches the end.IOException- an I/O error has occurredPacketTooLongException- if a packet read is longer than a defined limit
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-