Package de.freaklamarsch.systarest
Class STouchProtocol.ByteReaderWriter
java.lang.Object
de.freaklamarsch.systarest.STouchProtocol.ByteReaderWriter
- All Implemented Interfaces:
STouchProtocol.ObjectReaderWriter<java.lang.Integer>
- Enclosing class:
- STouchProtocol
private static class STouchProtocol.ByteReaderWriter extends java.lang.Object implements STouchProtocol.ObjectReaderWriter<java.lang.Integer>
PUT OBJECT PARSERS INTO THIS SECTION *****************
parsers should be private **************************** custom objects should
be defined in the next section *
-
Constructor Summary
Constructors Modifier Constructor Description private
ByteReaderWriter()
-
Method Summary
Modifier and Type Method Description java.lang.Integer
readFromBuffer(java.nio.ByteBuffer buffer)
Parses the command from the received buffer and returns a parsed object.int
writeToBuffer(java.nio.ByteBuffer buffer, java.lang.Integer object)
Converts the parsed object into the reply buffer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ByteReaderWriter
private ByteReaderWriter()
-
-
Method Details
-
readFromBuffer
public java.lang.Integer readFromBuffer(java.nio.ByteBuffer buffer)Description copied from interface:STouchProtocol.ObjectReaderWriter
Parses the command from the received buffer and returns a parsed object.- Specified by:
readFromBuffer
in interfaceSTouchProtocol.ObjectReaderWriter<java.lang.Integer>
- Parameters:
buffer
- the buffer containing the data to read- Returns:
- the parsed object
-
writeToBuffer
public int writeToBuffer(java.nio.ByteBuffer buffer, java.lang.Integer object)Description copied from interface:STouchProtocol.ObjectReaderWriter
Converts the parsed object into the reply buffer.- Specified by:
writeToBuffer
in interfaceSTouchProtocol.ObjectReaderWriter<java.lang.Integer>
- Parameters:
buffer
- the buffer to write toobject
- the object to convert- Returns:
- the length of the bytes written to the buffer
-