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

org.jace.parser.constant.DoubleConstant 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 DoubleConstant implements Constant
{
	private final int highByte;
	private final int lowByte;

	public DoubleConstant(int highByte, int lowByte)
	{
		this.highByte = highByte;
		this.lowByte = lowByte;
	}

	@Override
	public Object getValue()
	{
		return new Double(((long) highByte << 32) | lowByte);
	}

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

	@Override
	public void write(DataOutputStream output) throws IOException
	{
		output.writeByte(new DoubleConstantReader().getTag());
		output.writeInt(highByte);
		output.writeInt(lowByte);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy