Package warrenfalk.lzma

Examples of warrenfalk.lzma.LzmaOutputStream$Marshaler


    File test = new File("/dev/shm", fnonrand.getName() + ".lzma");
    File fin = new File("/dev/shm", fnonrand.getName() + ".final");
    long start = System.nanoTime();
    FileOutputStream fos = new FileOutputStream(test);
    FileInputStream fis = new FileInputStream(fnonrand);
    LzmaOutputStream los = new LzmaOutputStream(fos, -1, new byte[4096], 1 << 22, 3, 0, 2, 1 << 0x20);
    byte[] buffer = new byte[4096];
    int len;
    while (-1 != (len = fis.read(buffer, 0, buffer.length))) {
      los.write(buffer, 0, len);
    }
    fis.close();
    los.close();
    long end = System.nanoTime();
    System.out.println("" + ((double)(end - start) / 1000000000.0) + " seconds");
   
    start = System.nanoTime();
    fos = new FileOutputStream(fin);
View Full Code Here


  public void testEncodeWithError() throws IOException {
    File test = new File("/dev/shm", fnonrand.getName() + ".lzma");
    long start = System.nanoTime();
    FileOutputStream fos = new FileOutputStream(test);
    InputStream fis = new FailInputStream(fnonrand);
    LzmaOutputStream los = new LzmaOutputStream(fos, -1, new byte[4096], 1 << 22, 3, 0, 2, 1 << 0x20);
    byte[] buffer = new byte[4096];
    int len;
    while (-1 != (len = fis.read(buffer, 0, buffer.length))) {
      los.write(buffer, 0, len);
    }
    fis.close();
    los.close();
    long end = System.nanoTime();
    System.out.println("" + ((double)(end - start) / 1000000000.0) + " seconds");
  }
View Full Code Here

TOP

Related Classes of warrenfalk.lzma.LzmaOutputStream$Marshaler

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.