Package org.yamcs.tse
Class ResponseBuffer
- java.lang.Object
-
- org.yamcs.tse.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 Summary
Constructors Constructor Description ResponseBuffer(String responseTermination)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(byte b)voidappend(byte[] b)voidappend(byte[] b, int off, int len)byte[]readSingleResponse()Reads a single 'complete' response.byte[]readSingleResponse(boolean force)
-
-
-
Constructor Detail
-
ResponseBuffer
public ResponseBuffer(String responseTermination)
-
-
Method Detail
-
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).- Returns:
- bytes with termination stripped off.
-
readSingleResponse
public byte[] readSingleResponse(boolean force)
-
-