public boolean [ ] readBooleans ( int length ) throws KryoException { boolean [ ] array = new boolean [ length ] ; if ( optional ( length ) == length ) { byte [ ] buffer = this . buffer ; int p = this . position ; for ( int i = 0 ; i < length ; i ++ , p ++ ) array [ i ] = buffer [ p ] != 0 ; position = p ; } else { for ( int i = 0 ; i < length ; i ++ ) array [ i ] = readBoolean ( ) ; } return array ; }
Reads a boolean array in bulk . This may be more efficient than reading them individually .