Package com.orientechnologies.orient.core.compression

Examples of com.orientechnologies.orient.core.compression.OCompression


    for (int i = 0; i < iterationsCount; i++) {
      int contentSize = random.nextInt(10 * 1024 - 100) + 100;
      byte[] content = new byte[contentSize];
      random.nextBytes(content);

      OCompression compression = OCompressionFactory.INSTANCE.getCompression(name);

      final byte[] compressedContent = compression.compress(content);

      compressedSize += compressedContent.length;

      Assert.assertEquals(content, compression.uncompress(compressedContent));
    }

    System.out.println("Compression/Decompression test against " + name + " took: " + (System.currentTimeMillis() - seed)
        + "ms, total byte size: " + compressedSize);
  }
View Full Code Here


    for (String name : OCompressionFactory.INSTANCE.getCompressions()) {
      compressedSize = 0;
      long startTime = System.currentTimeMillis();

      for (int i = 0; i < iterationsCount; i++) {
        final OCompression compression = OCompressionFactory.INSTANCE.getCompression(name);

        final byte[] compressedContent = compression.compress(contents[i]);

        compressedSize += compressedContent.length;

        // Assert.assertEquals(contents[i], compression.uncompress(compressedContent));
      }
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.compression.OCompression

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.