Package de.jarnbjo.jsnappy

Examples of de.jarnbjo.jsnappy.SnzInputStream


        int iterations = 2500;

        long t0 = System.nanoTime();
        for(int i=0; i<iterations; i++) {
          SnzInputStream sis = mt ?
              new SnzMTInputStream(new ByteArrayInputStream(compressed)) :
              new SnzInputStream(new ByteArrayInputStream(compressed));
          while((r = sis.read(dummy)) >= 0) {
            l += r;
          }
        }
        long t1 = System.nanoTime();
        lall += l;
View Full Code Here


        SnzOutputStream sos = new SnzOutputStream(compressedData);
        sos.write(originalData);
        sos.close();
       
        ByteArrayOutputStream decompressedData = new ByteArrayOutputStream();
        SnzInputStream sis = new SnzInputStream(new ByteArrayInputStream(compressedData.toByteArray()));
        TestUtil.pipe(sis, decompressedData);
        Assert.assertArrayEquals(originalData, decompressedData.toByteArray());
      }
    }
   
View Full Code Here

    for (File org : testdataDirectory.listFiles()) {
      if (org.isFile()) {
        System.out.println("comparing " + org.getName());
        byte[] originalData = TestUtil.readFully(org);
        ByteArrayOutputStream decompressedData = new ByteArrayOutputStream();
        SnzInputStream sis = new SnzInputStream(new FileInputStream(new File(tmpDirectory, org.getName() + ".snz")));
        TestUtil.pipe(sis, decompressedData);
        sis.close();
        Assert.assertArrayEquals(originalData, decompressedData.toByteArray());
      }
    }
  }
View Full Code Here

TOP

Related Classes of de.jarnbjo.jsnappy.SnzInputStream

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.