Package org.toubassi.femtozip.models

Examples of org.toubassi.femtozip.models.VerboseStringCompressionModel


    }

    @Test
    public void testThreading() throws IOException, InterruptedException {
       
        testThreadedCompressionModel(new VerboseStringCompressionModel());
        testThreadedCompressionModel(new FemtoZipCompressionModel());
        testThreadedCompressionModel(new GZipDictionaryCompressionModel());
        testThreadedCompressionModel(new GZipCompressionModel());
        testThreadedCompressionModel(new PureHuffmanCompressionModel());
        testThreadedCompressionModel(new VariableIntCompressionModel());
View Full Code Here


    private String pack(String s, String dict) {
        try {
            byte[] bytes = s.getBytes("UTF-8");
            byte[] dictBytes = dict == null ? null : dict.getBytes("UTF-8");
           
            VerboseStringCompressionModel model = new VerboseStringCompressionModel();
            model.setDictionary(dictBytes);
            byte[] compressed = model.compress(bytes);
            byte[] decompressed = model.decompress(compressed);
           
            Assert.assertEquals("Compressed: " + (new String(compressed, "UTF-8")), s, new String(decompressed, "UTF-8"));
           
            return new String(compressed, "UTF-8");
        }
View Full Code Here

   
    @Test
    public void testCompressionModels() throws IOException {
        String[][] testPairs = {{PreambleString, PreambleDictionary}, {"",""}};
        for (String[] testPair : testPairs) {
            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

TOP

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

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.