Examples of ByteSerializer


Examples of net.sf.rej.util.ByteSerializer

        out.println("---- code ends ----");
    }

    public byte[] getData() {
        updateLabelPositions();
        ByteSerializer ser = new ByteSerializer(true);
        DecompilationContext dc = createDecompilationContext();
        for (Instruction instruction : this.code) {
            ser.addBytes(instruction.getData(dc));
            dc.incrementPosition(instruction);
        }

        return ser.getBytes();
    }
View Full Code Here

Examples of net.sf.rej.util.ByteSerializer

  public Exceptions() {
  }

  public byte[] getData() {
    ByteSerializer ser = new ByteSerializer(true);
    ser.addShort(this.exceptions.size());
    for (int i = 0; i < this.exceptions.size(); i++) {
      ExceptionInfo e = this.exceptions.get(i);
      ser.addBytes(e.getData());
    }

    return ser.getBytes();
  }
View Full Code Here

Examples of net.sf.rej.util.ByteSerializer

    return info.getDescriptor();
  }

  @Override
  public byte[] getData() {
    ByteSerializer ser = new ByteSerializer(true);
    ser.addByte(getType());
    ser.addShort(this.classIndex);
    ser.addShort(this.nameAndTypeIndex);

    return ser.getBytes();
  }
View Full Code Here

Examples of net.sf.rej.util.ByteSerializer

        return "(int) " + String.valueOf(this.value);
    }

    @Override
  public byte[] getData() {
        ByteSerializer ser = new ByteSerializer(true);
        ser.addByte(getType());
        ser.addInt(this.value);

        return ser.getBytes();
    }
View Full Code Here

Examples of net.sf.rej.util.ByteSerializer

    this.value = newValue;
  }

  @Override
  public byte[] getData() {
    ByteSerializer ser = new ByteSerializer(true);
    ser.addByte(getType());
    try {
      byte[] data = this.value.getBytes("UTF-8");
      ser.addShort(data.length);
      ser.addBytes(data);
    } catch (Exception e) {
      e.printStackTrace();
    }

    return ser.getBytes();
  }
View Full Code Here

Examples of net.sf.rej.util.ByteSerializer

   * Serializes this constant pool into a byte array. The serialization format
   * is according to the java class file format.
   * @return this constant pool as a byte array.
   */
  public byte[] getData() {
        ByteSerializer ser = new ByteSerializer(true);
        ser.addShort(size());

        for (int i = 1; i < size(); i++) {
            ConstantPoolInfo cpi = get(i);
            ser.addBytes(cpi.getData());
           
            // 2 word(8 byte) types take up 2 indices
            if (cpi.getType() == ConstantPoolInfo.LONG
               || cpi.getType() == ConstantPoolInfo.DOUBLE) {
              i++;
            }
        }
       
        return ser.getBytes();
  }
View Full Code Here

Examples of net.sf.rej.util.ByteSerializer

    this.increment = (int) ByteToolkit.getLong(data, 2, 1, true);
  }

  @Override
  public byte[] getData(DecompilationContext dc) {
    ByteSerializer ser = new ByteSerializer(true);
    ser.addByte(OPCODE);
    ser.addByte(this.index);
    ser.addByte(this.increment);

    return ser.getBytes();
  }
View Full Code Here

Examples of net.sf.rej.util.ByteSerializer

  public int getWideSize(DecompilationContext dc) {
    return WIDE_SIZE;
  }

  public byte[] getWideData(DecompilationContext dc) {
    ByteSerializer ser = new ByteSerializer(true);
    ser.addByte(_wide.OPCODE);
    ser.addByte(OPCODE);
    ser.addShort(this.index);
    ser.addShort(this.increment);

    return ser.getBytes();
  }
View Full Code Here

Examples of net.sf.rej.util.ByteSerializer

    this.index = (int) ByteToolkit.getLong(data, 1, 2, true);
  }

  @Override
  public byte[] getData(DecompilationContext dc) {
    ByteSerializer ser = new ByteSerializer(true);
    ser.addByte(OPCODE);
    ser.addShort(this.index);
    return ser.getBytes();
  }
View Full Code Here

Examples of net.sf.rej.util.ByteSerializer

    this.index = (int) ByteToolkit.getLong(data, 1, 1, true);
  }

  @Override
  public byte[] getData(DecompilationContext dc) {
    ByteSerializer ser = new ByteSerializer(true);
    ser.addByte(OPCODE);
    ser.addByte(this.index);
    return ser.getBytes();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.