Ejemplo n.º 1
0
 /**
  * Deserialize a ByteBuffer into a KeyboardInstant object.
  *
  * @param p_buffer
  * @return
  */
 public static KeyboardInstant deserialize(EasyBuffering p_buffer) {
   EnumMap<KeysConfiguration, Boolean> instant =
       new EnumMap<KeysConfiguration, Boolean>(KeysConfiguration.class);
   boolean[] bools = p_buffer.readBooleans(KEYS_LENGTH);
   int index = 0;
   for (KeysConfiguration key : KeysConfiguration.values()) {
     instant.put(key, bools[index++]);
   }
   return new KeyboardInstant(instant);
 }