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.ShortIntegerReaderWritershortIntegerReaderWriter -
Constructor Summary
Constructors Modifier Constructor Description privateColorReaderWriter() -
Method Summary
Modifier and Type Method Description private intget16BitValueFromColor(java.awt.Color color)private java.awt.ColorgetColorFrom16BitValue(int colorCode16bit)java.awt.ColorreadFromBuffer(java.nio.ByteBuffer buffer)Parses the command from the received buffer and returns a parsed object.intwriteToBuffer(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.ObjectReaderWriterParses the command from the received buffer and returns a parsed object.- Specified by:
readFromBufferin 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.ObjectReaderWriterConverts the parsed object into the reply buffer.- Specified by:
writeToBufferin 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)
-