public LBuffer slice ( long from , long to ) { if ( from > to ) throw new IllegalArgumentException ( String . format ( "invalid range %,d to %,d" , from , to ) ) ; long size = to - from ; LBuffer b = new LBuffer ( size ) ; copyTo ( from , b , 0 , size ) ; return b ; }
Extract a slice [ from to ) of this buffer . This methods creates a copy of the specified region .