Deserializer { public float readFloat() { _detectBufferUnderflow(4); float f = BigEndianCodec.getFloat(_buffer, _index); _index += 4; return f; } Deserializer(ByteBuffer byteBuffer); boolean readBoolean(); byte readByte(); char readChar(); double readDouble(); float readFloat(); int readInt(); long readLong(); T readObject(); short readShort(); String readString();  }
@Test public void testReadFloat() { ByteBuffer byteBuffer = ByteBuffer.allocate(_COUNT * 4); byteBuffer.order(ByteOrder.BIG_ENDIAN); FloatBuffer floatBuffer = byteBuffer.asFloatBuffer(); float[] floats = new float[_COUNT]; for (int i = 0; i < _COUNT; i++) { floats[i] = _random.nextFloat(); floatBuffer.put(floats[i]); } Deserializer deserializer = new Deserializer(byteBuffer); for (int i = 0; i < _COUNT; i++) { Assert.assertEquals( (Float)floats[i], (Float)deserializer.readFloat()); } }