public byte [ ] getBytes ( ) { byte [ ] retval = new byte [ buffer . b ( ) . position ( ) ] ; int position = buffer . b ( ) . position ( ) ; buffer . b ( ) . rewind ( ) ; buffer . b ( ) . get ( retval ) ; assert position == buffer . b ( ) . position ( ) ; return retval ; }
This method is slow and horrible . It entails an extra copy . Don t use it! Ever! Not even for test! Just say no to test only code . It will also leak the BBContainer if this FS is being used with a pool .