Package de.freaklamarsch.systarest
Class STouchProtocol.ColorReaderWriter
java.lang.Object
de.freaklamarsch.systarest.STouchProtocol.ColorReaderWriter
- All Implemented Interfaces:
STouchProtocol.ObjectReaderWriter<java.awt.Color>
- Enclosing class:
- STouchProtocol
private static class STouchProtocol.ColorReaderWriter extends java.lang.Object implements STouchProtocol.ObjectReaderWriter<java.awt.Color>
-
Field Summary
Fields Modifier and Type Field Description private STouchProtocol.ShortIntegerReaderWriter
shortIntegerReaderWriter
-
Constructor Summary
Constructors Modifier Constructor Description private
ColorReaderWriter()
-
Method Summary
Modifier and Type Method Description private int
get16BitValueFromColor(java.awt.Color color)
private java.awt.Color
getColorFrom16BitValue(int colorCode16bit)
java.awt.Color
readFromBuffer(java.nio.ByteBuffer buffer)
Parses the command from the received buffer and returns a parsed object.int
writeToBuffer(java.nio.ByteBuffer buffer, java.awt.Color color)
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
-
Field Details
-
shortIntegerReaderWriter
-
-
Constructor Details
-
ColorReaderWriter
private ColorReaderWriter()
-
-
Method Details
-
readFromBuffer
public java.awt.Color 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.awt.Color>
- Parameters:
buffer
- the buffer containing the data to read- Returns:
- the parsed object
-
writeToBuffer
public int writeToBuffer(java.nio.ByteBuffer buffer, java.awt.Color color)Description copied from interface:STouchProtocol.ObjectReaderWriter
Converts the parsed object into the reply buffer.- Specified by:
writeToBuffer
in interfaceSTouchProtocol.ObjectReaderWriter<java.awt.Color>
- Parameters:
buffer
- the buffer to write tocolor
- the object to convert- Returns:
- the length of the bytes written to the buffer
-
getColorFrom16BitValue
private java.awt.Color getColorFrom16BitValue(int colorCode16bit) -
get16BitValueFromColor
private int get16BitValueFromColor(java.awt.Color color)
-