Пример #1
0
 /** Serializes into a ByteBuffer for a given protocol. */
 public void serialize(ByteBuffer buffer, BinaryProtocol protocol) {
   protocol.putString(name, buffer);
   LogUtils.writeInt(buffer, id);
 }
Пример #2
0
 /** Returns serialized for a given protocol. */
 public int serializedSize(BinaryProtocol protocol) {
   return protocol.stringSize(name) + 4;
 }
Пример #3
0
 /** Serializes from a ByteBuffer for a given protocol. */
 public static NameIdPair deserialize(ByteBuffer buffer, BinaryProtocol protocol) {
   return new NameIdPair(protocol.getString(buffer), LogUtils.readInt(buffer));
 }