Examples of decodeInts()


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

    public void testDeltaEncodings() throws IOException, Pack200Exception {
        Codec c = Codec.UDELTA5;
        int[] sequence = new int[] {0, 2, 4, 2, 2, 4};
        byte[] encoded = c.encode(sequence);
        int[] decoded = c.decodeInts(6, new ByteArrayInputStream(encoded));
        for (int i = 0; i < decoded.length; i++) {
            assertEquals(sequence[i], decoded[i]);
        }
    }
View Full Code Here

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.Codec.decodeInts()

    public void testDeltaEncodings() throws IOException, Pack200Exception {
        Codec c = Codec.UDELTA5;
        int[] sequence = new int[] {0, 2, 4, 2, 2, 4};
        byte[] encoded = c.encode(sequence);
        int[] decoded = c.decodeInts(6, new ByteArrayInputStream(encoded));
        for (int i = 0; i < decoded.length; i++) {
            assertEquals(sequence[i], decoded[i]);
        }
    }
View Full Code Here

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);
        }
        // Useful for debugging -E options:
View Full Code Here

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.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
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.