All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.saidgadjiev.proxymaker.bytecode.constantpool.IntegerInfo Maven / Gradle / Ivy

There is a newer version: 1.17
Show newest version
package ru.saidgadjiev.proxymaker.bytecode.constantpool;

import java.io.DataOutputStream;
import java.io.IOException;

/**
 * This class represent integer in constant pool.
 */
public class IntegerInfo extends ConstantInfo {

    /**
     * Integer constant tag.
     */
    private static final int TAG = 3;

    /**
     * Target value.
     */
    private int value;

    /**
     * Constructor create a new instance with {@code value}.
     * @param value target value
     * @param index index in constant pool
     */
    public IntegerInfo(int value, int index) {
        super(index);
        this.value = value;
    }

    @Override
    public int getTag() {
        return TAG;
    }

    @Override
    public void write(DataOutputStream dataOutputStream) throws IOException {
        dataOutputStream.writeByte(TAG);
        dataOutputStream.writeInt(value);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy