File: RawAppInfo.java

package info (click to toggle)
pilot-link 0.12.5-dfsg-2
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 6,868 kB
  • ctags: 5,811
  • sloc: ansic: 53,153; sh: 10,459; java: 2,584; perl: 2,247; python: 1,044; makefile: 991; yacc: 662; cpp: 551; xml: 39
file content (50 lines) | stat: -rw-r--r-- 1,137 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package org.gnu.pilotlink;


public class RawAppInfo extends AppInfo {
    byte buffer[];
    String categories[]=new String[16];
    boolean isRenamed[]=new boolean[16];
    int catCount=0;
    
    public RawAppInfo(byte b[]) {
        setBuffer(b);
    }
    
    public byte[] getBuffer() {
        return buffer;
    }
    
    public void setBuffer(byte b[]) {
        buffer=b;
        int bits=b[0]*256+b[1];
       
        catCount=0;
        for (int i=0; i<16; i++) {
            if (b[2+i*16]!=0) {
                categories[i]=new String(b,2+i*16,16);
                System.out.println("Got Category: \""+categories[i]+"\"");
                catCount++;
            } else {
                categories[i]=null;
            }
            if ( (bits&(1<<i))!=0) {
                isRenamed[i]=true;
            } else {
                isRenamed[i]=false;
            }
        }
        
    }

    public boolean isCatRenamed(int idx) {
        return isRenamed[idx];
    }
    
    public String getCatName(int idx) {
        return categories[idx];
    }
    public int getCatCount() {
        return catCount;
    }
}