/** * Uncompress the provided data, data can be detected as compressed using {@link #isCompressed(BytesReference)}. * @throws NullPointerException a NullPointerException will be thrown when bytes is null */ public static BytesReference uncompressIfNeeded(BytesReference bytes) throws IOException { Compressor compressor = compressor(Objects.requireNonNull(bytes, "the BytesReference must not be null")); BytesReference uncompressed; if (compressor != null) { uncompressed = uncompress(bytes, compressor); } else { uncompressed = bytes; } return uncompressed; }
/** Return the uncompressed bytes. */ public byte[] uncompressed() { try { return BytesReference.toBytes(CompressorFactory.uncompress(new BytesArray(bytes))); } catch (IOException e) { throw new IllegalStateException("Cannot decompress compressed string", e); } }
/** Decompress the provided {@link BytesReference}. */ public static BytesReference uncompress(BytesReference bytes) throws IOException { Compressor compressor = compressor(bytes); if (compressor == null) { throw new NotCompressedException(); } return uncompress(bytes, compressor); }
/** * Uncompress the provided data, data can be detected as compressed using {@link #isCompressed(BytesReference)}. * @throws NullPointerException a NullPointerException will be thrown when bytes is null */ public static BytesReference uncompressIfNeeded(BytesReference bytes) throws IOException { Compressor compressor = compressor(Objects.requireNonNull(bytes, "the BytesReference must not be null")); BytesReference uncompressed; if (compressor != null) { uncompressed = uncompress(bytes, compressor); } else { uncompressed = bytes; } return uncompressed; }
/** * Uncompress the provided data, data can be detected as compressed using {@link #isCompressed(BytesReference)}. */ public static BytesReference uncompressIfNeeded(BytesReference bytes) throws IOException { Compressor compressor = compressor(bytes); BytesReference uncompressed; if (compressor != null) { uncompressed = uncompress(bytes, compressor); } else { uncompressed = bytes; } return uncompressed; }
/** * Uncompress the provided data, data can be detected as compressed using {@link #isCompressed(BytesReference)}. * @throws NullPointerException a NullPointerException will be thrown when bytes is null */ public static BytesReference uncompressIfNeeded(BytesReference bytes) throws IOException { Compressor compressor = compressor(Objects.requireNonNull(bytes, "the BytesReference must not be null")); BytesReference uncompressed; if (compressor != null) { uncompressed = uncompress(bytes, compressor); } else { uncompressed = bytes; } return uncompressed; }
/** * Uncompress the provided data, data can be detected as compressed using {@link #isCompressed(BytesReference)}. * @throws NullPointerException a NullPointerException will be thrown when bytes is null */ public static BytesReference uncompressIfNeeded(BytesReference bytes) throws IOException { Compressor compressor = compressor(Objects.requireNonNull(bytes, "the BytesReference must not be null")); BytesReference uncompressed; if (compressor != null) { uncompressed = uncompress(bytes, compressor); } else { uncompressed = bytes; } return uncompressed; }
/** Return the uncompressed bytes. */ public byte[] uncompressed() { try { return BytesReference.toBytes(CompressorFactory.uncompress(new BytesArray(bytes))); } catch (IOException e) { throw new IllegalStateException("Cannot decompress compressed string", e); } }
/** Return the uncompressed bytes. */ public byte[] uncompressed() { try { return BytesReference.toBytes(CompressorFactory.uncompress(new BytesArray(bytes))); } catch (IOException e) { throw new IllegalStateException("Cannot decompress compressed string", e); } }
/** Return the uncompressed bytes. */ public byte[] uncompressed() { try { return CompressorFactory.uncompress(new BytesArray(bytes)).toBytes(); } catch (IOException e) { throw new IllegalStateException("Cannot decompress compressed string", e); } }
/** Return the uncompressed bytes. */ public byte[] uncompressed() { try { return BytesReference.toBytes(CompressorFactory.uncompress(new BytesArray(bytes))); } catch (IOException e) { throw new IllegalStateException("Cannot decompress compressed string", e); } }
/** Decompress the provided {@link BytesReference}. */ public static BytesReference uncompress(BytesReference bytes) throws IOException { Compressor compressor = compressor(bytes); if (compressor == null) { throw new NotCompressedException(); } return uncompress(bytes, compressor); }
/** Decompress the provided {@link BytesReference}. */ public static BytesReference uncompress(BytesReference bytes) throws IOException { Compressor compressor = compressor(bytes); if (compressor == null) { throw new NotCompressedException(); } return uncompress(bytes, compressor); }
/** Decompress the provided {@link BytesReference}. */ public static BytesReference uncompress(BytesReference bytes) throws IOException { Compressor compressor = compressor(bytes); if (compressor == null) { throw new NotCompressedException(); } return uncompress(bytes, compressor); }
/** Decompress the provided {@link BytesReference}. */ public static BytesReference uncompress(BytesReference bytes) throws IOException { Compressor compressor = compressor(bytes); if (compressor == null) { throw new NotCompressedException(); } return uncompress(bytes, compressor); }