title: Compressed string length somewhat greater than original string length?
body: <p>I've created an application for compressing and decompressing the string using inflator and deflator. The application is working properly when tested on simple word statements and getting compressed into a string whose length is smaller than original string length,but the problem is when I tries using encrypted string I'm getting the compressed string length somewhat greater than original string length.<br>
  Can anyone please tell me some solution of this?</p>
  
  <pre><code>    private String compress(String stringToCompress) throws UnsupportedEncodingException
      {
          byte[] compressedData = new byte[1024];
          byte[] stringAsBytes = stringToCompress.getBytes("UTF-8");
  
          Deflater compressor = new Deflater();
          compressor.setInput(stringAsBytes);
          compressor.finish();
          int compressedDataLength = compressor.deflate(compressedData);
  
          byte[] bytes = Arrays.copyOf(compressedData, compressedDataLength);
          return Base64.encodeBase64String(bytes);
      }
  
      private String decompressToString(String base64String) throws UnsupportedEncodingException, DataFormatException
      {
          byte[] compressedData = Base64.decodeBase64(base64String);
  
          Inflater deCompressor = new Inflater();
          deCompressor.setInput(compressedData, 0, compressedData.length);
          byte[] output = new byte[102400];
          int decompressedDataLength = deCompressor.inflate(output);
          deCompressor.end();
  
          return new String(output, 0, decompressedDataLength, "UTF-8");
      }
  </code></pre>
  
  <p><strong>WHEN</strong></p>
  
  <pre><code>public static void main(String[] args)    
          {
           Sample_class = new Sample_class();
           S String strToBeCompressed  = "Pehla nasha Pehla khumaar Naya pyaar hai nayaPehla nasha Pehla khumaar Naya pyaar hai nayaPehla nasha Pehla khumaar Naya pyaar hai nayaPehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya intezaar Kar loon main kPehla nasha Pehla khumaar Naya pyaar hai naya intezaar Kar loon main kya apna haal Aye dil-e-bekaraar Mere dil-e-bekaraar Tu hi bata Pehla nasha Pehla khumaar Udta hi firoon in hawaon mein kahin Ya main jhool jaoon in ghataon mein kahin Udta hi firoon in hawaon mein kahin Ya main jhool jaoon in ghataon mein kahin ";
  
           System.out.println(strToBeCompressed);
           String compressedData  = m.compress(strToBeCompressed);
           String deCompressedString = m.decompressToString(compressedData);
           System.out.println("Original     :: " + strToBeCompressed.length());
           System.out.println("Compressed   :: " + compressedData.toString().length());
           System.out.println("decompressed :: " + deCompressedString.length());
          }
  </code></pre>
  
  <p><strong>OUTPUT</strong></p>
  
  <pre><code>Pehla nasha Pehla khumaar Naya pyaar hai nayaPehla nasha Pehla khumaar Naya pyaar hai nayaPehla nasha Pehla khumaar Naya pyaar hai nayaPehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya Pehla nasha Pehla khumaar Naya pyaar hai naya intezaar Kar loon main kPehla nasha Pehla khumaar Naya pyaar hai naya intezaar Kar loon main kya apna haal Aye dil-e-bekaraar Mere dil-e-bekaraar Tu hi bata Pehla nasha Pehla khumaar Udta hi firoon in hawaon mein kahin Ya main jhool jaoon in ghataon mein kahin Udta hi firoon in hawaon mein kahin Ya main jhool jaoon in ghataon mein kahin 
  Original     :: 980
  Compressed   :: 212
  decompressed :: 980
  </code></pre>
  
  <p><strong>BUT WHEN</strong> </p>
  
  <pre><code>    public static void main(String[] args)    
      {
       Sample_class = new Sample_class();
       String strToBeCompressed = "iVBORw0KGgoAAAANSUhEUgAAAMUAAADFCAIAAABrWqGnAACAAElEQVR42uy9aYxk2XXn14BswNIY8BiGP3lgD7x8GBvjD5IM2TOaMWRbguERaGOokTSSRqJIUWKTItkkm0uT3c1e2c2q6q6qrr0q933P2Pc94r14+77vW+yRa2VVZVZmVvq+yO5ik5LGGktiF4EJHDy8jIqqioj3e//zP/eee/M50zT39vbORo/Dw8Ojo6MnT56cfWKP07MTEMdhPDk+Ozt+Esbpydnp0dnx47OTk7MzEE9GcXb65Al48ePHZ6enZ6fHYTw8ONwaPGi17vv+tmGAGOg6iL5hgOgaVsc02qbiapzFkwaLOxwdSHxXUfqaZpKUSdM2L7YMs+P6vuu5tuNZZltS+5IyVDRwdEhabsAqjNgENTTAH8ktUeoqaltRXJ4H0ZYkE6qrlYJSKej1stGogKNLNPsyqzWrKlJ1WGxoSru+PrCkrs63TSlo2U7L1j0dhN1zBw+2Ds6ODs9OD8/OHoafGnyq8MOCD3p+WcDVOT09PTk5AcenV+oTvGTn//X5u3r99def29/fPz4+Pn8KnIBnP8n3d/7NnYzg+HGeRk+dhjw9OT0J3zxg6En4+vDk9Ozw6Pj+3kG3u+U5AKAQkVH0VBWwcs5TRzc7ug548jXeFzkQbVnoafKWroPwGc7nhZaktnSjY7kt23VNy5EVQEyHF3uiDHhq86JHswHL9yTFpRiDIAFh50h1ZPB/abuWZTchpZzn82m5nD9HykTqHonA8XUkHeFreYBUT+MHhrhlyTuB1Wm7Qdu1A8v0DICU0basjmf1/IPTx/dPjg6fnJzzBD7rSfix//IrehLeaM8GT0+ffQoTeHxi7++cj5MRIk9OR1/j6TlP58oEnj0Ob86TUJnCF5+dPT55fHBwvz8Y+C7AxZflQBA8juvJ8ognra/pfd0C0dFtgFRP17qafE7bQA6jL0gdlm/RHCBmoGiAjK5q9GynbZhArgA9HkW7JNXm+K4gdngBRF+SA4Z1";
  
       System.out.println(strToBeCompressed);
       String compressedData  = m.compress(strToBeCompressed);
       String deCompressedString = m.decompressToString(compressedData);
       System.out.println("Original     :: " + strToBeCompressed.length());
       System.out.println("Compressed   :: " + compressedData.toString().length());
       System.out.println("decompressed :: " + deCompressedString.length());
      }
  </code></pre>
  
  <p><strong>OUTPUT</strong></p>
  
  <pre><code>iVBORw0KGgoAAAANSUhEUgAAAMUAAADFCAIAAABrWqGnAACAAElEQVR42uy9aYxk2XXn14BswNIY8BiGP3lgD7x8GBvjD5IM2TOaMWRbguERaGOokTSSRqJIUWKTItkkm0uT3c1e2c2q6q6qrr0q933P2Pc94r14+77vW+yRa2VVZVZmVvq+yO5ik5LGGktiF4EJHDy8jIqqioj3e//zP/eee/M50zT39vbORo/Dw8Ojo6MnT56cfWKP07MTEMdhPDk+Ozt+Esbpydnp0dnx47OTk7MzEE9GcXb65Al48ePHZ6enZ6fHYTw8ONwaPGi17vv+tmGAGOg6iL5hgOgaVsc02qbiapzFkwaLOxwdSHxXUfqaZpKUSdM2L7YMs+P6vuu5tuNZZltS+5IyVDRwdEhabsAqjNgENTTAH8ktUeoqaltRXJ4H0ZYkE6qrlYJSKej1stGogKNLNPsyqzWrKlJ1WGxoSru+PrCkrs63TSlo2U7L1j0dhN1zBw+2Ds6ODs9OD8/OHoafGnyq8MOCD3p+WcDVOT09PTk5AcenV+oTvGTn//X5u3r99def29/fPz4+Pn8KnIBnP8n3d/7NnYzg+HGeRk+dhjw9OT0J3zxg6En4+vDk9Ozw6Pj+3kG3u+U5AKAQkVH0VBWwcs5TRzc7ug548jXeFzkQbVnoafKWroPwGc7nhZaktnSjY7kt23VNy5EVQEyHF3uiDHhq86JHswHL9yTFpRiDIAFh50h1ZPB/abuWZTchpZzn82m5nD9HykTqHonA8XUkHeFreYBUT+MHhrhlyTuB1Wm7Qdu1A8v0DICU0basjmf1/IPTx/dPjg6fnJzzBD7rSfix//IrehLeaM8GT0+ffQoTeHxi7++cj5MRIk9OR1/j6TlP58oEnj0Ob86TUJnCF5+dPT55fHBwvz8Y+C7AxZflQBA8juvJ8ognra/pfd0C0dFtgFRP17qafE7bQA6jL0gdlm/RHCBmoGiAjK5q9GynbZhArgA9HkW7JNXm+K4gdngBRF+SA4Z1
  Original     :: 1032
  Compressed   :: 1076
  decompressed :: 1032
  </code></pre>