public static final String remainingToHex ( ByteBuffer bb ) { byte [ ] buf = new byte [ bb . remaining ( ) ] ; int safe = bb . position ( ) ; bb . get ( buf ) ; bb . position ( safe ) ; return toHex ( buf ) ; }
Creates readable view to byte buffer remaining . Doesn t change byte buffer .