Java Deflate Byte Array deflateBuffer(byte[] uncompressedBuffer)

Here you can find the source of deflateBuffer(byte[] uncompressedBuffer)

Description

deflate Buffer

License

Open Source License

Declaration

private static byte[] deflateBuffer(byte[] uncompressedBuffer) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.ByteArrayOutputStream;
import java.io.IOException;

import java.util.zip.DeflaterOutputStream;

public class Main {
    private static byte[] deflateBuffer(byte[] uncompressedBuffer) throws IOException {
        final DeflaterOutputStream deflateStream = new DeflaterOutputStream(new ByteArrayOutputStream());

        deflateStream.write(uncompressedBuffer, 0, uncompressedBuffer.length);
        deflateStream.close();// w w  w  .  j  av  a  2  s. c  o m

        return uncompressedBuffer;
    }
}

Related

  1. deflate(byte[] in)
  2. deflate(byte[] input)
  3. deflate(final byte[] pInput)
  4. deflate(String inString)
  5. deflate(String text, String encode)
  6. deflateByteArray(final byte[] array)
  7. deflateGzip(byte[] inputBytes)
  8. deflateGzip(final byte[] bts)
  9. deflater(final byte[] inputByte)