Java Byte Array Decompress decompress_action(byte[] source)

Here you can find the source of decompress_action(byte[] source)

Description

Main process of decompression with Linear Prediction

License

Open Source License

Declaration


public static int decompress_action(byte[] source) 

Method Source Code

//package com.java2s;

public class Main {
    /******************************************************Main process of decompression with Linear Prediction**************************/
//from   ww  w .  j av  a  2s.co m
    public static int decompress_action(byte[] source) {
        int numbits = 8;
        int i = 0;
        int value = 0;

        if (source.length <= 20) {
            return 2;
        }

        for (i = 0; i < numbits; i++) {
            if (((source[20]) & (1 << i)) == 1) {
                value |= (1 << i);
            }
        }
        //System.out.println("value!:" + value + "\n");
        if (value == 0x12)
            return 1;
        else
            return 0;

    }
}

Related

  1. decompress(byte src[], int src_off, int src_len, byte dst[], int dst_off, int dst_len)
  2. decompress(byte[] compressed, int sequenceLen)
  3. decompress(byte[] in, int len)
  4. decompressHuffman(byte[] message, int length)
  5. decompressRTF(byte[] src)