01: /* ===========================================================================
02: * $RCSfile: LineNumberInfo.java,v $
03: * ===========================================================================
04: *
05: * RetroGuard -- an obfuscation package for Java classfiles.
06: *
07: * Copyright (c) 1998-2006 Mark Welsh (markw@retrologic.com)
08: *
09: * This program can be redistributed and/or modified under the terms of the
10: * Version 2 of the GNU General Public License as published by the Free
11: * Software Foundation.
12: *
13: * This program is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16: * GNU General Public License for more details.
17: *
18: */
19:
20: package COM.rl.obf.classfile;
21:
22: import java.io.*;
23: import java.util.*;
24:
25: /**
26: * Representation of an Line Number table entry.
27: *
28: * @author Mark Welsh
29: */
30: public class LineNumberInfo {
31: // Constants -------------------------------------------------------------
32:
33: // Fields ----------------------------------------------------------------
34: private int u2startpc;
35: private int u2lineNumber;
36:
37: // Class Methods ---------------------------------------------------------
38: public static LineNumberInfo create(DataInput din) throws Exception {
39: LineNumberInfo lni = new LineNumberInfo();
40: lni.read(din);
41: return lni;
42: }
43:
44: // Instance Methods ------------------------------------------------------
45: private LineNumberInfo() {
46: }
47:
48: private void read(DataInput din) throws Exception {
49: u2startpc = din.readUnsignedShort();
50: u2lineNumber = din.readUnsignedShort();
51: }
52:
53: /** Export the representation to a DataOutput stream. */
54: public void write(DataOutput dout) throws Exception {
55: dout.writeShort(u2startpc);
56: dout.writeShort(u2lineNumber);
57: }
58: }
|