Package at.molindo.thirdparty.com.yahoo.platform.yui.compressor

Examples of at.molindo.thirdparty.com.yahoo.platform.yui.compressor.CssCompressor


  }

  public static String compress(final String toCompress) {
    final StringWriter writer = new StringWriter((int) (toCompress.length() * 0.8));
    try {
      new CssCompressor(new StringReader(toCompress)).compress(writer, 0);
    } catch (final Exception e) {
      log.warn("Could not compress merged CSS stream, using uncompressed content", e);
      return toCompress;
    }
    return writer.toString();
View Full Code Here


  public static byte[] compress(final byte[] toCompress, Charset charset) {
    ByteArrayOutputStream out = new ByteArrayOutputStream(toCompress.length);

    final OutputStreamWriter writer = new OutputStreamWriter(out);
    try {
      new CssCompressor(new InputStreamReader(new ByteArrayInputStream(toCompress), charset)).compress(writer, 0);
      writer.flush();
      writer.close();
    } catch (final Exception e) {
      log.warn("Could not compress merged CSS stream, using uncompressed content", e);
      return toCompress;
View Full Code Here

TOP

Related Classes of at.molindo.thirdparty.com.yahoo.platform.yui.compressor.CssCompressor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.