Java Utililty Methods Zip String

List of utility methods to do Zip String

Description

The list of methods to do Zip String are organized into topic(s).

Method

byte[]zipStringToBytes(String input)
Gzip the input string into a byte[].
ByteArrayOutputStream bos = new ByteArrayOutputStream();
BufferedOutputStream bufos = new BufferedOutputStream(new GZIPOutputStream(bos));
bufos.write(input.getBytes("UTF-8"));
bufos.close();
byte[] retval = bos.toByteArray();
bos.close();
return retval;
byte[]zipText(String text)
zip Text
byte[] ba = null;
GZIPOutputStream gzos = null;
ByteArrayOutputStream baos = null;
try {
    baos = new ByteArrayOutputStream();
    if (baos != null) {
        gzos = new GZIPOutputStream(baos);
        byte[] stringAsBytes = (text).getBytes("UTF-8");
...