Package org.yamcs.tctm
Interface PacketInputStream
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
CcsdsPacketInputStream
,CfdpPacketInputStream
,FixedPacketInputStream
,GenericPacketInputStream
Interface implemented by the classes that read packets from an input stream.
It is used by TM data links which work with streams, such as TcpTmDataLink
An object of this class will be instantiated each time a stream (e.g. socket or file) will be open.
Each implementing class has to have a constructor taking a InputStream
and YConfiguration
as
arguments.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
init
(InputStream stream, YConfiguration config) 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.
-
Method Details
-
init
Called each time an input stream is opened to initialize the object- Parameters:
stream
-config
-
-
readPacket
read the next packet - blocking if necessary until all the data is available.- 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
-