/** * Decompressed the given byte[] * * @param compressed - the compressed byte[] * @return an input stream of the uncompressed byte[] */ public static byte[] decompress(byte[] compressed) { if (compressed == null) { LOGGER.debug("Compressed bytes[] are null. Returning empty byte[]."); return new byte[]{}; } try { InputStream decompressed = decompressToStream(compressed); if (decompressed != null) { return IOUtils.toByteArray(decompressed); } } catch (IOException e) { LOGGER.error("Exception occurred while decompressing gzip stream. Returning empty byte[].", e); } return new byte[]{}; }
/** * Decompressed the given byte[] * * @param compressed - the compressed byte[] * @return an input stream of the uncompressed byte[] */ public static byte[] decompress(byte[] compressed) { if (compressed == null) { LOGGER.debug("Compressed bytes[] are null. Returning empty byte[]."); return new byte[]{}; } try { InputStream decompressed = decompressToStream(compressed); if (decompressed != null) { return IOUtils.toByteArray(decompressed); } } catch (IOException e) { LOGGER.error("Exception occurred while decompressing gzip stream. Returning empty byte[].", e); } return new byte[]{}; }
private void fromProtocolBuffers(BinaryTimeSeries binaryTimeSeries, long queryStart, long queryEnd, MetricTimeSeries.Builder builder) { final InputStream decompressed = Compression.decompressToStream(binaryTimeSeries.getPoints()); ProtoBufMetricTimeSeriesSerializer.from(decompressed, binaryTimeSeries.getStart(), binaryTimeSeries.getEnd(), queryStart, queryEnd, builder); IOUtils.closeQuietly(decompressed); }
private void fromProtocolBuffers(BinaryTimeSeries binaryTimeSeries, long queryStart, long queryEnd, MetricTimeSeries.Builder builder) { final InputStream decompressed = Compression.decompressToStream(binaryTimeSeries.getPoints()); ProtoBufKassiopeiaSimpleSerializer.from(decompressed, binaryTimeSeries.getStart(), binaryTimeSeries.getEnd(), queryStart, queryEnd, builder); }
InputStream decompressed = Compression.decompressToStream(data); ProtoBufMetricTimeSeriesSerializer.from(decompressed, tsStart, tsEnd, queryStart, queryEnd, ts); IOUtils.closeQuietly(decompressed);