Package org.zeroturnaround.zip

Examples of org.zeroturnaround.zip.ByteSource


   */
  public void transform(InputStream in, ZipEntry zipEntry, ZipOutputStream out) throws IOException {
    byte[] bytes = IOUtils.toByteArray(in);
    bytes = transform(zipEntry, bytes);

    ByteSource source;

    if (preserveTimestamps()) {
      source = new ByteSource(zipEntry.getName(), bytes, zipEntry.getTime());
    }
    else {
      source = new ByteSource(zipEntry.getName(), bytes);
    }

    ZipEntrySourceZipEntryTransformer.addEntry(source, out);
  }
View Full Code Here


  public void transform(InputStream in, ZipEntry zipEntry, ZipOutputStream out) throws IOException {
    String data = IOUtils.toString(in, encoding);
    data = transform(zipEntry, data);
    byte[] bytes = encoding == null ? data.getBytes() : data.getBytes(encoding);
    ByteSource source = new ByteSource(zipEntry.getName(), bytes);
    ZipEntrySourceZipEntryTransformer.addEntry(source, out);
  }
View Full Code Here

TOP

Related Classes of org.zeroturnaround.zip.ByteSource

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.