Package org.h2.compress

Examples of org.h2.compress.Compressor.expand()


            byte[] result = new byte[pageSize];
            long time = System.currentTimeMillis();
            for (int i = 0; i < 1000; i++) {
                for (int k = 0; k < comp.size(); k++) {
                    byte[] data = comp.get(k);
                    compress.expand(data, 0, data.length, result, 0, pageSize);
                }
            }
            System.out.println("expand: " + (System.currentTimeMillis() - time) + " ms");
        }
    }
View Full Code Here


                    // empty
                } else {
                    byte[] compressBuffer = new byte[size];
                    in.readFully(compressBuffer, 0, size);
                    try {
                        compress.expand(compressBuffer, 0, size, data, 0, pageSize);
                    } catch (ArrayIndexOutOfBoundsException e) {
                        throw DbException.convertToIOException(e);
                    }
                }
                String typeName = "";
View Full Code Here

                    // empty
                } else {
                    byte[] compressBuffer = new byte[size];
                    in.readFully(compressBuffer, 0, size);
                    try {
                        compress.expand(compressBuffer, 0, size, data, 0, pageSize);
                    } catch (ArrayIndexOutOfBoundsException e) {
                        throw DbException.convertToIOException(e);
                    }
                }
                String typeName = "";
View Full Code Here

                } else if (size == 1) {
                    // empty
                } else {
                    byte[] compressBuffer = new byte[size];
                    in.readFully(compressBuffer, 0, size);
                    compress.expand(compressBuffer, 0, size, data, 0, pageSize);
                }
                String typeName = "";
                int type = data[0];
                boolean last = (type & Page.FLAG_LAST) != 0;
                type &= ~Page.FLAG_LAST;
View Full Code Here

            byte[] result = new byte[pageSize];
            long time = System.currentTimeMillis();
            for (int i = 0; i < 1000; i++) {
                for (int k = 0; k < comp.size(); k++) {
                    byte[] data = comp.get(k);
                    compress.expand(data, 0, data.length, result, 0, pageSize);
                }
            }
            System.out.println("expand: " + (System.currentTimeMillis() - time) + " ms");
        }
    }
View Full Code Here

        Compressor compress = getCompressor(algorithm);
        try {
            int len = readVariableInt(in, 1);
            int start = 1 + getVariableIntLength(len);
            byte[] buff = Utils.newBytes(len);
            compress.expand(in, start, in.length - start, buff, 0, len);
            return buff;
        } catch (Exception e) {
            throw DbException.get(ErrorCode.COMPRESSION_ERROR, e);
        }
    }
View Full Code Here

        int algorithm = in[0];
        Compressor compress = getCompressor(algorithm);
        try {
            int len = readVariableInt(in, 1);
            int start = 1 + getVariableIntLength(len);
            compress.expand(in, start, in.length - start, out, outPos, len);
        } catch (Exception e) {
            throw DbException.get(ErrorCode.COMPRESSION_ERROR, e);
        }
    }
View Full Code Here

        Compressor compress = getCompressor(algorithm);
        try {
            int len = readInt(in, 1);
            int start = 1 + getLength(len);
            byte[] buff = Utils.newBytes(len);
            compress.expand(in, start, in.length - start, buff, 0, len);
            return buff;
        } catch (Exception e) {
            throw DbException.get(ErrorCode.COMPRESSION_ERROR, e);
        }
    }
View Full Code Here

        int algorithm = in[0];
        Compressor compress = getCompressor(algorithm);
        try {
            int len = readInt(in, 1);
            int start = 1 + getLength(len);
            compress.expand(in, start, in.length - start, out, outPos, len);
        } catch (Exception e) {
            throw DbException.get(ErrorCode.COMPRESSION_ERROR, e);
        }
    }
View Full Code Here

                    CompressTool tool = CompressTool.getInstance();
                    byte[] buff = new byte[1024];
                    Random r = new Random();
                    while (!stop) {
                        r.nextBytes(buff);
                        byte[] test = tool.expand(tool.compress(buff, "LZF"));
                        assertEquals(buff, test);
                    }
                }
            };
            tasks[i] = t;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.