01: // Copyright (c) 1997 Per M.A. Bothner.
02: // This is free software; for terms and warranty disclaimer see ./COPYING.
03:
04: package gnu.bytecode;
05:
06: import java.io.*;
07:
08: /* Represents a generic uninterpreted or unknown attribute.
09: * @author Per Bothner
10: */
11:
12: public class MiscAttr extends Attribute {
13: byte[] data;
14: int offset;
15: int length;
16:
17: public MiscAttr(String name, byte[] data, int offset, int length) {
18: super (name);
19: this .data = data;
20: this .offset = offset;
21: this .length = length;
22: }
23:
24: public MiscAttr(String name, byte[] data) {
25: this (name, data, 0, data.length);
26: }
27:
28: public int getLength() {
29: return length;
30: }
31:
32: public void write(DataOutputStream dstr) throws java.io.IOException {
33: dstr.write(data, offset, length);
34: }
35:
36: }
|