Code example for ByteBuffer

Methods: getDouble, getInt

0
			serializer.serialize(buffer, obj.name);
			serializer.serialize(buffer, obj.energy);
		} 
 
		public Object deserialize(RbSerializer serializer, ByteBuffer buffer) {
			Bullet bullet = new Bullet(0, 0, 0, 0, null, null, false, buffer.getInt());
			String name = serializer.deserializeString(buffer);
			double energy = buffer.getDouble();
 
			return new BulletHitEvent(name, energy, bullet);
		} 
	} 
}