public String getJSON(long maxBytes) {
        try {
            switch (getGELFType()) {
                case ZLIB:
                    return Tools.decompressZlib(payload, maxBytes);
                case GZIP:
                    return Tools.decompressGzip(payload, maxBytes);
                case UNCOMPRESSED:
                    return new String(payload, StandardCharsets.UTF_8);
                case CHUNKED:
                case UNSUPPORTED:
                    throw new IllegalStateException("Unknown GELF type. Not supported.");
            }
        } catch (final IOException e) {
            // Note that the UnsupportedEncodingException thrown by 'new String' can never happen because UTF-8
            // is a mandatory JRE encoding which is always present. So we only need to mention the decompress exceptions here.
            throw new IllegalStateException("Failed to decompress the GELF message payload", e);
        }
        return null;
    }
public String getJSON ( long maxBytes ) { try { switch ( getGELFType ( ) ) { case ZLIB : return Tools . decompressZlib ( payload , maxBytes ) ; case GZIP : return Tools . decompressGzip ( payload , maxBytes ) ; case UNCOMPRESSED : return new String ( payload , StandardCharsets . UTF_8 ) ; case CHUNKED : case UNSUPPORTED : throw new IllegalStateException ( "Unknown GELF type. Not supported." ) ; } } catch ( final IOException e ) { throw new IllegalStateException ( "Failed to decompress the GELF message payload" , e ) ; } return null ; }
Return the JSON payload of the GELF message.

@param maxBytes The maximum number of bytes to read from a compressed GELF payload. {@code -1} means unlimited.
@return The extracted JSON payload of the GELF message.
@see Tools#decompressGzip(byte[], long)
@see Tools#decompressZlib(byte[], long)