You clean your payload on every get, since the Pair constructor calls clean() on it...
1 2 3 4 5 6
| public Pair(Payload payload, T value) { this.payload = payload; this.value = value; this.payload.clean().reset(); } |
Unoffensive tip: learn how stepping and variable inspection work in your IDEs debugger

Btw. this code produces a lot of garbage (memory management wise), since you effectively creating multiple temporary Pair objects on every get call. Better refactor the gets to some equivalents of your put mechanism.
Thanks for this, I don't know what I was thinking when I put that in the constructor. Completely my fault for working on this at 3AM in the morning.
Also I hope I refactored properly, I've edited the original post with the updated source.
Edit: Also it appears getDouble or putDouble may not be working properly.
1 2 3 4 5 6 7 8
| Payload p = new Payload(32); p.putDouble(123.10d); p.putFloat(123.10f); p.putLong(0x73FD73FDL);
p.reset();
System.out.println("Double: " + p.getDouble() + ", Float: " + p.getFloat() + ", Long: " + Long.toHexString(p.getLong())); |
Output:
1
| Double: 8.49591604E-315, Float: 123.1, Long: 73fd73fd |