Package org.yamcs.tse
Class ResponseBuffer
java.lang.Object
org.yamcs.tse.ResponseBuffer
Buffers TSE output for extracting individual "responses". A response is defined as a string that ends with a
configurable response termination.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(byte b) void
append
(byte[] b) void
append
(byte[] b, int off, int len) byte[]
Reads a single 'complete' response.byte[]
readSingleResponse
(boolean force)
-
Constructor Details
-
ResponseBuffer
- Parameters:
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).- Returns:
- bytes with termination stripped off.
-
readSingleResponse
public byte[] readSingleResponse(boolean force)
-