Subversion Repositories svn.mios

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
628 adamjking 1
/*
2
 * @(#)Block.java   beta8   2006/04/23
3
 *
4
 * Copyright (C) 2008   Jason Williams
5
 *
6
 * This application is free software; you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation; either version 2 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This application is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this application; if not, write to the Free Software
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 */
20
 
21
package org.midibox.mios;
22
 
23
import org.midibox.utils.Utils;
24
 
25
public class Block {
26
    public long lAddress;
27
    public long lAddressMapped;
28
 
29
    public byte[] axData;
30
 
31
    public Block() {
32
        lAddress = 0;
33
        lAddressMapped = 0;
34
        axData = null;
35
    }
36
 
37
    public void dump() {
38
        int n = 0;
39
        int nRows = (axData.length / 16);
40
        if (axData.length % 16 != 0) {
41
            nRows++;
42
        }
43
        for (int nRow = 0; nRow < nRows; nRow++) {
44
            System.out.print(Utils.longToHex(lAddress + (nRow * 16)) + "  ");
45
 
46
            for (int nCol = 0; nCol < 16; nCol++) {
47
                if (n < axData.length) {
48
                    System.out.print(Utils.byteToHex(axData[n]));
49
                    System.out.print(" ");
50
                }
51
                n++;
52
            }
53
            System.out.println();
54
        }
55
        System.out.println();
56
    }
57
}