Interface PacketInputStream

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
CcsdsPacketInputStream, CfdpPacketInputStream, FixedPacketInputStream, GenericPacketInputStream

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 and YConfiguration as arguments.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    init(InputStream stream, YConfiguration config)
    Called each time an input stream is opened to initialize the object
    byte[]
    read the next packet - blocking if necessary until all the data is available.

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • 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 occurred
      PacketTooLongException - if a packet read is longer than a defined limit