Package net.sf.rej.util

Examples of net.sf.rej.util.ByteArrayByteParser


  }

  @Override
  public void setPayload(byte[] data) {
    super.setPayload(data);
        ByteParser parser = new ByteArrayByteParser(data);
        parser.setBigEndian(true);
        int count = parser.getShortAsInt();
        this.entries = new ArrayList<LocalVariableTypeEntry>(count);
        for (int i=0; i < count; i++) {
          int startPc = parser.getShortAsInt();
          int length = parser.getShortAsInt();
          int nameIndex = parser.getShortAsInt();
          int signatureIndex = parser.getShortAsInt();
          int index = parser.getShortAsInt();
          LocalVariableTypeEntry entry = new LocalVariableTypeEntry(this.pool, startPc, length, nameIndex, signatureIndex, index);
          entries.add(entry);
        }
  }
View Full Code Here


        return ser.getBytes();
    }
   
    @Override
    public void setPayload(byte[] data) {
        ByteParser parser = new ByteArrayByteParser(data);
        parser.setBigEndian(true);
        int length = parser.getShortAsInt();
        for (int i = 0; i < length; i++) {
            LocalVariable lv = new LocalVariable(parser, pool);
            this.localVariables.add(lv);
        }
    }
View Full Code Here

    super(nameIndex, pool);
  }

  @Override
  public void setPayload(byte[] data) {
        ByteParser parser = new ByteArrayByteParser(data);
        parser.setBigEndian(true);
        this.signatureIndex = parser.getShortAsInt();
  }
View Full Code Here

      return ByteToolkit.longToTwoBytes(this.constant, true);
    }
   
    @Override
    public void setPayload(byte[] data) {
        ByteParser parser = new ByteArrayByteParser(data);
        parser.setBigEndian(true);
        this.constant = parser.getShortAsInt();
    }
View Full Code Here

  }

  @Override
  public void setData(byte[] data, DecompilationContext dc) {
    ByteParser parser = new ByteArrayByteParser(data);
    parser.setBigEndian(true);
    parser.getByte(); // throw away OPCODE

    while ((dc.getPosition() + parser.getPosition()) % 4 != 0) {
      parser.getByte(); // throw away bytes until we are in a position
      // divisible by 4
    }

    this.def = new Label((int) parser.getInt() + dc.getPosition(),
        "lookup_label_def");

    int npairs = (int) parser.getInt();

    this.offsets = new HashMap<Integer, Label>();

    for (int i = 0; i < npairs; i++) {
      int match = (int) parser.getInt();
      int offset = (int) parser.getInt();
      Label label = new Label(dc.getPosition() + offset, "lookup_label_"
          + match);
      this.offsets.put(match, label);
    }
  }
View Full Code Here

TOP

Related Classes of net.sf.rej.util.ByteArrayByteParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.