question: private ByteBuffer expandBuffer ( ByteBuffer original , int cap ) { ByteBuffer res = ByteBuffer . allocate ( cap ) ; res . order ( ByteOrder . nativeOrder ( ) ) ; original . flip ( ) ; res . put ( original ) ; return res ; }
target:  Expands the given byte buffer to the requested capacity.