public class Jieya {
private ArrayList<Integer> list = new ArrayList<Integer>();// 存高八位
private int count = 0;// 下标
private ArrayList<Integer> numlist = new ArrayList<>();// 存编码
HashMap<String, Integer> hm = new HashMap<>();// 编码表
HashMap<Integer, String> hm1 = new HashMap<>();// 编码表
private String cw = "";
private String pw = "";
private String p = "";
private String c = "";
private int bianma = 256;
public void jieya(String path, String path1) throws IOException {
// 读取压缩文件
InputStream is = new FileInputStream(path);
byte[] buffer = new byte[is.available()];
is.read(buffer);
is.close();// 关闭流
String str = new String(buffer);
// System.out.println(str);
// 读高八位 把高八位所表示的数字放入List中
for (int i = 0; i < buffer.length; i += 2) {
int a = buffer;
list.add(a);// 高八位存入list列表中
}
for (int i = 1; i < buffer.length; i += 2) {// 读低八位
// System.out.println(list.get(count)+"---");
if (buffer == -1 && buffer[i - 1] == -1) {
numlist.add(65535);
} else {
// System.out.println(i);
if (list.get(count) > 0) {// 如果低八位对应的高八位为1
if (buffer < 0) {
int a = buffer + 256 + 256 * list.get(count);
// buffer+=256+256*list.get(count);
numlist.add(a);// 存入numlist中
} else {
int a = buffer + 256 * (list.get(count));
// System.out.println(buffer+" "+a + "+++");
numlist.add(a);// 存入numlist中