private String getUTF8String(byte[] b, int off, int len) throws CharacterCodingException {
        StringBuilder sb = new StringBuilder();
        
        int read = 0;
        while (read < len){
            // Either read n remaining bytes in b or 250 if n is higher.
            int toRead = Math.min(len - read, byteBuf.capacity());
            
            boolean endOfInput = toRead < byteBuf.capacity();
            
            // read 'toRead' bytes into byteBuf
            byteBuf.put(b, off + read, toRead);
            
            // set limit to position and set position to 0
            // so data can be decoded
            byteBuf.flip();
            
            // decode data in byteBuf
            CoderResult result = utf8Decoder.decode(byteBuf, charBuf, endOfInput);
            
            // If the result is not an underflow, it's an error
            // that cannot be handled.
            // If the error is an underflow and it's the end of input,
            // then the decoder expects more bytes, but there are no more => error.
            if (!result.isUnderflow() || !endOfInput){
                result.throwException();
            }
            
            // flip the char buf to get the string just decoded
            charBuf.flip();
            
            // append the decoded data into the StringBuilder
            sb.append(charBuf.toString());
            
            // clear buffers for next use
            byteBuf.clear();
            charBuf.clear();
            
            read += toRead;
        }
        
        return sb.toString();
    }
<code>HttpZipLocator</code> is similar to {@link ZipLocator}, except
it allows loading assets from a <code>.ZIP</code> file on the web instead of
on the local filesystem.
<p>
The root path must be a valid HTTP(S) {@link URL} pointing to ZIP or
ZIP-like file (such as a JAR). For example,<br>
<code>https://www.example.com/my/sub/path/assets.zip</code>.
<p>
The locator is designed in such a way that it does not require downloading
the entire <code>.ZIP</code> file from the web in order to load
assets from it. Instead, the ZIP header is extracted first, and then
is used to lookup assets from within the ZIP file and download them
as requested by the user. 

@author Kirill Vainer
jme3-core/src/plugins/java/com/jme3/asset/plugins/HttpZipLocator.java