Package org.yamcs.tse

Class ResponseBuffer


public class ResponseBuffer extends Object
Buffers TSE output for extracting individual "responses". A response is defined as a string that ends with a configurable response termination.
  • Constructor Details

    • ResponseBuffer

      public ResponseBuffer(String responseTermination, boolean fragmented)
      responseTermination - characters that indicate the end of a message. May be null if there is no such indication.
      fragmented - whether multiple responses may need to be reassembled before obtaining a complete message.
  • Method Details

    • append

      public void append(byte b)
    • append

      public void append(byte[] b)
    • append

      public void append(byte[] b, int off, int len)
    • readSingleResponse

      public byte[] readSingleResponse()
      Reads a single 'complete' response. If no response termination is defined, this will always return null (rely on timeouts).
      bytes with termination stripped off.
    • readSingleResponse

      public byte[] readSingleResponse(boolean force)