Package org.toubassi.femtozip.models

Examples of org.toubassi.femtozip.models.VariableIntCompressionModel


            competingModels = new CompressionModel[5];
            competingModels[0] = new FemtoZipCompressionModel();
            competingModels[1] = new PureHuffmanCompressionModel();
            competingModels[2] = new GZipCompressionModel();
            competingModels[3] = new GZipDictionaryCompressionModel();
            competingModels[4] = new VariableIntCompressionModel();
        }
       
        if (results == null) {
            results = new ArrayList<ModelOptimizationResult>();
        }
View Full Code Here


        testThreadedCompressionModel(new VerboseStringCompressionModel());
        testThreadedCompressionModel(new FemtoZipCompressionModel());
        testThreadedCompressionModel(new GZipDictionaryCompressionModel());
        testThreadedCompressionModel(new GZipCompressionModel());
        testThreadedCompressionModel(new PureHuffmanCompressionModel());
        testThreadedCompressionModel(new VariableIntCompressionModel());
    }
View Full Code Here

            testModel(testPair[0], testPair[1], new VerboseStringCompressionModel(), testPair[0].length() == 0 ? -1 : 363);
            testModel(testPair[0], testPair[1], new FemtoZipCompressionModel(), testPair[0].length() == 0 ? -1 : 205);
            testModel(testPair[0], testPair[1], new GZipDictionaryCompressionModel(), testPair[0].length() == 0 ? -1 : 204);
            testModel(testPair[0], testPair[1], new GZipCompressionModel(), testPair[0].length() == 0 ? -1 : 210);
            testModel(testPair[0], testPair[1], new PureHuffmanCompressionModel(), testPair[0].length() == 0 ? -1 : 211);
            testModel(testPair[0], testPair[1], new VariableIntCompressionModel(), testPair[0].length() == 0 ? -1 : 333);
        }
    }
View Full Code Here

   
    @Test
    public void testVariableIntCompressionModel() throws IOException {
        String source = "12345";
        byte[] sourceBytes = source.getBytes("UTF-8");
        VariableIntCompressionModel model = new VariableIntCompressionModel();
        model.build(new ArrayDocumentList(sourceBytes));
       
        byte[] compressedBytes = model.compress(sourceBytes);

        Assert.assertEquals(2, compressedBytes.length);

        byte[] decompressedBytes = model.decompress(compressedBytes);
        String decompressedString = new String(decompressedBytes);
       
        Assert.assertEquals(source, decompressedString);
       
    }
View Full Code Here

TOP

Related Classes of org.toubassi.femtozip.models.VariableIntCompressionModel

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.