String getString ( final long off , final int lenBytes ) throws IOException , InterruptedException { if ( off < 0 || off > zipFileSlice . len - lenBytes ) { throw new IndexOutOfBoundsException ( ) ; } final byte [ ] scratchToUse = lenBytes <= scratch . length ? scratch : new byte [ lenBytes ] ; if ( read ( off , scratchToUse , 0 , lenBytes ) < lenBytes ) { throw new EOFException ( "Unexpected EOF" ) ; } // Assume the entry names are encoded in UTF-8 (should be the case for all jars; the only other // valid zipfile charset is CP437, which is the same as ASCII for printable high-bit-clear chars) return new String ( scratchToUse , 0 , lenBytes , StandardCharsets . UTF_8 ) ; }
Get a string from the zipfile slice .