Examples of decodeInts()


Examples of org.apache.harmony.pack200.Codec.decodeInts()

        int first = getFirst[0];
        if (codec.isSigned() && first >= -256 && first <= -1) {
            // Non-default codec should be used
            codecUsed = CodecEncoding.getCodec((-1 - first), header
                    .getBandHeadersInputStream(), codec);
            band = codecUsed.decodeInts(count, in);
        } else if (!codec.isSigned() && first >= codec.getL()
                && first <= codec.getL() + 255) {
            // Non-default codec should be used
            codecUsed = CodecEncoding.getCodec(first - codec.getL(), header
                    .getBandHeadersInputStream(), codec);
View Full Code Here

Examples of org.apache.harmony.pack200.Codec.decodeInts()

        } else if (!codec.isSigned() && first >= codec.getL()
                && first <= codec.getL() + 255) {
            // Non-default codec should be used
            codecUsed = CodecEncoding.getCodec(first - codec.getL(), header
                    .getBandHeadersInputStream(), codec);
            band = codecUsed.decodeInts(count, in);
        } else {
            // First element should not be discarded
            band = codec.decodeInts(count - 1, in, first);
        }
        if (codecUsed instanceof BHSDCodec && ((BHSDCodec) codecUsed).isDelta()) {
View Full Code Here

Examples of org.apache.harmony.pack200.RunCodec.decodeInts()

        byte[] bytes2 = Codec.UNSIGNED5.encode(new int[] { 5, 10, 20 });
        byte[] bandEncoded = new byte[bytes1.length + bytes2.length];
        System.arraycopy(bytes1, 0, bandEncoded, 0, bytes1.length);
        System.arraycopy(bytes2, 0, bandEncoded, bytes1.length, bytes2.length);
        RunCodec runCodec = new RunCodec(5, Codec.DELTA5, Codec.UNSIGNED5);
        int[] bandDecoded = runCodec.decodeInts(8, new ByteArrayInputStream(
                bandEncoded));
        assertEquals(band.length, bandDecoded.length);
        for (int i = 0; i < band.length; i++) {
            assertEquals(band[i], bandDecoded[i]);
        }
View Full Code Here

Examples of org.apache.harmony.pack200.RunCodec.decodeInts()

        byte[] bandEncoded = new byte[bytes1.length + bytes2.length];
        System.arraycopy(bytes1, 0, bandEncoded, 0, bytes1.length);
        System.arraycopy(bytes2, 0, bandEncoded, bytes1.length, bytes2.length);
        RunCodec runCodec = new RunCodec(5, Codec.DELTA5, new PopulationCodec(
                Codec.UNSIGNED5, Codec.BYTE1, Codec.UNSIGNED5));
        int[] bandDecoded = runCodec.decodeInts(band.length,
                new ByteArrayInputStream(bandEncoded));
        assertEquals(band.length, bandDecoded.length);
        for (int i = 0; i < band.length; i++) {
            assertEquals(band[i], bandDecoded[i]);
        }
View Full Code Here

Examples of org.apache.harmony.pack200.RunCodec.decodeInts()

        System.arraycopy(bytes2, 0, bandEncoded, bytes1.length, bytes2.length);
        System.arraycopy(bytes3, 0, bandEncoded, bytes1.length + bytes2.length,
                bytes3.length);
        RunCodec runCodec = new RunCodec(3, Codec.UDELTA5, new RunCodec(3,
                Codec.BYTE1, Codec.UNSIGNED5));
        int[] bandDecoded = runCodec.decodeInts(9, new ByteArrayInputStream(
                bandEncoded));
        assertEquals(band.length, bandDecoded.length);
        for (int i = 0; i < band.length; i++) {
            assertEquals(band[i], bandDecoded[i]);
        }
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.