public static byte [ ] [ ] split ( final byte [ ] a , final byte [ ] b , boolean inclusive , final int num ) { byte [ ] [ ] ret = new byte [ num + 2 ] [ ] ; int i = 0 ; Iterable < byte [ ] > iter = iterateOnSplits ( a , b , inclusive , num ) ; if ( iter == null ) { return null ; } for ( byte [ ] elem : iter ) { ret [ i ++ ] = elem ; } return ret ; }
Split passed range . Expensive operation relatively . Uses BigInteger math . Useful splitting ranges for MapReduce jobs .