Package com.thecoderscorner.menu.remote
Class SharedStreamConnection
java.lang.Object
com.thecoderscorner.menu.remote.SharedStreamConnection
- Direct Known Subclasses:
StreamRemoteConnector
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ByteBufferprotected final ByteBufferprotected final System.Loggerprotected static final intprotected final MenuCommandProtocol -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanprotected voidstatic booleandoesBufferHaveEOM(ByteBuffer inputBuffer) protected abstract voidgetAtLeastBytes(ByteBuffer inputBuffer, int len, StreamRemoteConnector.ReadMode mode) Reads at least the number of bytes requested waiting if need be for more data.abstract Stringabstract booleanprotected voidlogByteBuffer(String msg, ByteBuffer inBuffer) Helper method that logs the entire message buffer when at debug logging level.protected voidreadCompleteMessage(ByteBuffer inputBuffer) protected abstract voidsendInternal(ByteBuffer cmdBuffer) voidSends a command to the remote with the protocol and usual headers.
-
Field Details
-
logger
-
MAX_MSG_EXPECTED
protected static final int MAX_MSG_EXPECTED- See Also:
-
protocol
-
inputBuffer
-
cmdBuffer
-
-
Constructor Details
-
Method Details
-
readCommandFromStream
- Throws:
IOException
-
doesBufferHaveEOM
-
readCompleteMessage
- Throws:
IOException
-
logByteBuffer
Helper method that logs the entire message buffer when at debug logging level.- Parameters:
msg- the message to print firstinBuffer- the buffer to be logged
-
connectionLog
-
sendInternal
- Throws:
IOException
-
isDeviceConnected
public abstract boolean isDeviceConnected() -
getConnectionName
-