Example usage for java.util.zip InflaterOutputStream write

List of usage examples for java.util.zip InflaterOutputStream write

Introduction

In this page you can find the example usage for java.util.zip InflaterOutputStream write.

Prototype

public void write(int b) throws IOException 

Source Link

Document

Writes a byte to the uncompressed output stream.

Usage

From source file:de.siegmar.logbackgelf.GelfUdpAppenderTest.java

private JsonNode receiveCompressedMessage() throws IOException {
    final ByteArrayOutputStream bos = new ByteArrayOutputStream();
    final InflaterOutputStream inflaterOutputStream = new InflaterOutputStream(bos);

    inflaterOutputStream.write(server.getReceivedData());
    inflaterOutputStream.close();/* w ww . j  av  a2 s. co m*/

    return new ObjectMapper().readTree(bos.toByteArray());
}

From source file:org.xlcloud.console.saml2.Saml2ServiceProviderConsumerServlet.java

private byte[] inflate(byte[] responseBytes) throws IOException {
    Inflater inflater = new Inflater(true);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    InflaterOutputStream ios = new InflaterOutputStream(out, inflater);

    ios.write(responseBytes);
    ios.close();/*from   ww  w  .  j a  v a2  s  . c  om*/
    return out.toByteArray();
}