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

org.jace.parser.constant.IntegerConstant Maven / Gradle / Ivy

There is a newer version: 1.2.22
Show newest version
package org.jace.parser.constant;

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

public class IntegerConstant implements Constant
{
	private final int bytes;

	public IntegerConstant(int bytes)
	{
		this.bytes = bytes;
	}

	@Override
	public int getSize()
	{
		return 1;
	}

	@Override
	public Object getValue()
	{
		return Integer.valueOf(bytes);
	}

	@Override
	public void write(DataOutputStream output) throws IOException
	{
		output.writeByte(new IntegerConstantReader().getTag());
		output.writeInt(bytes);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy