private static String decompress(String str) throws EncoderException {
    /* First base64 decode the string */
    byte[] bytes = Base64.decodeBase64(str);
    GZIPInputStream zi = null;
    try {
      zi = new GZIPInputStream(new ByteArrayInputStream(bytes));
      InputStreamReader reader = new InputStreamReader(zi);
      BufferedReader in = new BufferedReader(reader);
      StringBuilder sb = new StringBuilder();
      String read;
      while ((read = in.readLine()) != null) {
        sb.append(read + "\n");
      }

      String molfile = sb.toString();
      reader.close();
      in.close();
      zi.close();
      return molfile;

    } catch (IOException e) {
      throw new EncoderException("Molfile could not be decompressed. " + str);
    } finally {
      IOUtils.closeQuietly(zi);
    }

  }
private static String decompress ( String str ) throws EncoderException { byte [ ] bytes = Base64 . decodeBase64 ( str ) ; GZIPInputStream zi = null ; try { zi = new GZIPInputStream ( new ByteArrayInputStream ( bytes ) ) ; InputStreamReader reader = new InputStreamReader ( zi ) ; BufferedReader in = new BufferedReader ( reader ) ; StringBuilder sb = new StringBuilder ( ) ; String read ; while ( ( read = in . readLine ( ) ) != null ) { sb . append ( read + "\n" ) ; } String molfile = sb . toString ( ) ; reader . close ( ) ; in . close ( ) ; zi . close ( ) ; return molfile ; } catch ( IOException e ) { throw new EncoderException ( "Molfile could not be decompressed. " + str ) ; } finally { IOUtils . closeQuietly ( zi ) ; } }
method to decompress the given molfile input

@param str the molefile input can be in base64 format or in the gzipped
Base64 format
@return molfile
@throws EncoderException