Package org.yamcs.tctm
Interface PacketInputStream
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
CcsdsPacketInputStream
,CfdpPacketInputStream
,GenericPacketInputStream
,UsocPacketInputStream
public interface PacketInputStream extends Closeable
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
andYConfiguration
as arguments.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
init(InputStream stream, YConfiguration config)
Called each time an input stream is opened to initialize the objectbyte[]
readPacket()
read the next packet - blocking if necessary until all the data is available.
-
-
-
Method Detail
-
init
void init(InputStream stream, YConfiguration config)
Called each time an input stream is opened to initialize the object- Parameters:
stream
-config
-
-
readPacket
byte[] readPacket() throws IOException, PacketTooLongException
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
-
-