private int readMultipleBytesSingleElement(byte[] b, int off, int len) throws IOException {
        int read = 0, totalRead = 0;
        
        switch (state) {
            case NEW_HEADER: 
                readNewHeader(); //fallthrough
            case PROCESS_TAG: {
                read = readHeaderBytes(currentHeader.getParsedTag().getEncoding(),
                                       State.PROCESS_LENGTH, b, off, len);
                if (!valuesOnly) {
                    totalRead += read;
                    if (totalRead == len)
                        return totalRead;
                    off += read;
                }
            } //fallthrough
            case PROCESS_LENGTH: {
                read = readHeaderBytes(currentHeader.getParsedLength().getEncoding(),
                                           State.PROCESS_VALUE, b, off, len);
                
                checkDone();
                
                if (!valuesOnly) {
                    totalRead += read;
                    if (totalRead == len || state == State.DONE)
                        return totalRead;
                    off += read;
                }
            } //fallthrough
            case PROCESS_VALUE:
                totalRead += readValueBytes(b, off, len);
                return totalRead;
            default:
                throw new UnsupportedOperationException(state.name());
        }
    }