package SerialImpl;
public class Int16
{
private byte high = 0x00;
private byte low = 0x00;
public Int16()
{}
public Int16(short value)
{
this.setValue(value);
}
public byte getHigh() {
return this.high;
}
public byte getLow() {
return this.low;
}
public void setHigh(byte high) {
this.high = high;
}
public void setLow(byte low) {
this.low = low;
}
public void setValue(short value)
{
this.low = (byte)(value & 0xFF);
this.high = (byte)((value >> 8) & 0xFF);
}
public short getValue()
{
return (short)(((short) ((this.high & 0xFF) << 8)) + ((short)(this.low & 0xFF)));
}
@Override
public String toString()
{
return String.valueOf(this.getValue());
}
}