Package org.yamcs.tctm
Class CcsdsPacketInputStream
java.lang.Object
org.yamcs.tctm.CcsdsPacketInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
,PacketInputStream
Reads CCSDS packets from an input stream: first it reads 6 bytes primary header, it derives the length from the last
two bytes and reads the remaining of the data.
It also support a maxLength property to limit the size of the packet that is being read.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
init
(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
-
maxPacketLength
protected int maxPacketLength
-
-
Constructor Details
-
CcsdsPacketInputStream
public CcsdsPacketInputStream()
-
-
Method Details
-
init
Description copied from interface:PacketInputStream
Called each time an input stream is opened to initialize the object- Specified by:
init
in interfacePacketInputStream
-
readPacket
Description copied from interface:PacketInputStream
read the next packet - blocking if necessary until all the data is available.- Specified by:
readPacket
in 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 occurred
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-