public abstract class org.fusesource.hawtbuf.AbstractVarIntSupport extends java.lang.Object
{
public void <init>()
{
org.fusesource.hawtbuf.AbstractVarIntSupport v;
v := @this: org.fusesource.hawtbuf.AbstractVarIntSupport;
specialinvoke v.<java.lang.Object: void <init>()>();
return;
}
protected abstract byte readByte() throws java.io.IOException;
protected abstract void writeByte(int) throws java.io.IOException;
public int readVarInt() throws java.io.IOException
{
org.fusesource.hawtbuf.AbstractVarIntSupport v;
byte v, v, v, v, v, v, v, v, v, v;
int v, v, v, v, v, v, v, v, v, v, v, v;
java.net.ProtocolException v;
v := @this: org.fusesource.hawtbuf.AbstractVarIntSupport;
v = virtualinvoke v.<org.fusesource.hawtbuf.AbstractVarIntSupport: byte readByte()>();
if v < 0 goto label;
return v;
label:
v = v & 127;
v = virtualinvoke v.<org.fusesource.hawtbuf.AbstractVarIntSupport: byte readByte()>();
if v < 0 goto label;
v = v << 7;
v = v | v;
goto label;
label:
v = v & 127;
v = v << 7;
v = v | v;
v = virtualinvoke v.<org.fusesource.hawtbuf.AbstractVarIntSupport: byte readByte()>();
if v < 0 goto label;
v = v << 14;
v = v | v;
goto label;
label:
v = v & 127;
v = v << 14;
v = v | v;
v = virtualinvoke v.<org.fusesource.hawtbuf.AbstractVarIntSupport: byte readByte()>();
if v < 0 goto label;
v = v << 21;
v = v | v;
goto label;
label:
v = v & 127;
v = v << 21;
v = v | v;
v = virtualinvoke v.<org.fusesource.hawtbuf.AbstractVarIntSupport: byte readByte()>();
v = v << 28;
v = v | v;
if v >= 0 goto label;
v = 0;
label:
if v >= 5 goto label;
v = virtualinvoke v.<org.fusesource.hawtbuf.AbstractVarIntSupport: byte readByte()>();
if v < 0 goto label;
return v;
label:
v = v + 1;
goto label;
label:
v = new java.net.ProtocolException;
specialinvoke v.<java.net.ProtocolException: void <init>(java.lang.String)>("Encountered a malformed variable int");
throw v;
label:
return v;
}
public long readVarLong() throws java.io.IOException
{
org.fusesource.hawtbuf.AbstractVarIntSupport v;
long v, v;
java.net.ProtocolException v;
short v;
byte v, v;
int v;
v := @this: org.fusesource.hawtbuf.AbstractVarIntSupport;
v = 0;
v = 0L;
label:
if v >= 64 goto label;
v = virtualinvoke v.<org.fusesource.hawtbuf.AbstractVarIntSupport: byte readByte()>();
v = v & 127;
v = v << v;
v = v | v;
v = v & 128;
if v != 0 goto label;
return v;
label:
v = v + 7;
goto label;
label:
v = new java.net.ProtocolException;
specialinvoke v.<java.net.ProtocolException: void <init>(java.lang.String)>("Encountered a malformed variable int");
throw v;
}
public int readVarSignedInt() throws java.io.IOException
{
int v, v;
org.fusesource.hawtbuf.AbstractVarIntSupport v;
v := @this: org.fusesource.hawtbuf.AbstractVarIntSupport;
v = virtualinvoke v.<org.fusesource.hawtbuf.AbstractVarIntSupport: int readVarInt()>();
v = staticinvoke <org.fusesource.hawtbuf.AbstractVarIntSupport: int decodeZigZag32(int)>(v);
return v;
}
public long readVarSignedLong() throws java.io.IOException
{
long v, v;
org.fusesource.hawtbuf.AbstractVarIntSupport v;
v := @this: org.fusesource.hawtbuf.AbstractVarIntSupport;
v = virtualinvoke v.<org.fusesource.hawtbuf.AbstractVarIntSupport: long readVarLong()>();
v = staticinvoke <org.fusesource.hawtbuf.AbstractVarIntSupport: long decodeZigZag64(long)>(v);
return v;
}
public void writeVarInt(int) throws java.io.IOException
{
org.fusesource.hawtbuf.AbstractVarIntSupport v;
int v, v, v, v, v;
v := @this: org.fusesource.hawtbuf.AbstractVarIntSupport;
v := @parameter: int;
label:
v = (int) -128;
v = v & v;
if v != 0 goto label;
virtualinvoke v.<org.fusesource.hawtbuf.AbstractVarIntSupport: void writeByte(int)>(v);
return;
label:
v = v & 127;
v = v | 128;
virtualinvoke v.<org.fusesource.hawtbuf.AbstractVarIntSupport: void writeByte(int)>(v);
v = v >>> 7;
goto label;
}
public void writeVarLong(long) throws java.io.IOException
{
org.fusesource.hawtbuf.AbstractVarIntSupport v;
byte v;
int v, v;
long v, v;
v := @this: org.fusesource.hawtbuf.AbstractVarIntSupport;
v := @parameter: long;
label:
v = v & -128L;
v = v cmp 0L;
if v != 0 goto label;
virtualinvoke v.<org.fusesource.hawtbuf.AbstractVarIntSupport: void writeByte(int)>(v);
return;
label:
v = v & 127;
v = v | 128;
virtualinvoke v.<org.fusesource.hawtbuf.AbstractVarIntSupport: void writeByte(int)>(v);
v = v >>> 7;
goto label;
}
public void writeVarSignedInt(int) throws java.io.IOException
{
int v, v;
org.fusesource.hawtbuf.AbstractVarIntSupport v;
v := @this: org.fusesource.hawtbuf.AbstractVarIntSupport;
v := @parameter: int;
v = staticinvoke <org.fusesource.hawtbuf.AbstractVarIntSupport: int encodeZigZag32(int)>(v);
virtualinvoke v.<org.fusesource.hawtbuf.AbstractVarIntSupport: void writeVarInt(int)>(v);
return;
}
public void writeVarSignedLong(long) throws java.io.IOException
{
long v, v;
org.fusesource.hawtbuf.AbstractVarIntSupport v;
v := @this: org.fusesource.hawtbuf.AbstractVarIntSupport;
v := @parameter: long;
v = staticinvoke <org.fusesource.hawtbuf.AbstractVarIntSupport: long encodeZigZag64(long)>(v);
virtualinvoke v.<org.fusesource.hawtbuf.AbstractVarIntSupport: void writeVarLong(long)>(v);
return;
}
private static int decodeZigZag32(int)
{
int v, v, v, v, v;
v := @parameter: int;
v = v >>> 1;
v = v & 1;
v = neg v;
v = v ^ v;
return v;
}
private static long decodeZigZag64(long)
{
long v, v, v, v, v;
v := @parameter: long;
v = v >>> 1;
v = v & 1L;
v = neg v;
v = v ^ v;
return v;
}
private static int encodeZigZag32(int)
{
int v, v, v, v;
v := @parameter: int;
v = v << 1;
v = v >> 31;
v = v ^ v;
return v;
}
private static long encodeZigZag64(long)
{
long v, v, v, v;
v := @parameter: long;
v = v << 1;
v = v >> 63;
v = v ^ v;
return v;
}
public static int computeVarIntSize(int)
{
int v, v, v, v, v, v, v;
v := @parameter: int;
v = (int) -128;
v = v & v;
if v != 0 goto label;
return 1;
label:
v = (int) -16384;
v = v & v;
if v != 0 goto label;
return 2;
label:
v = v & -2097152;
if v != 0 goto label;
return 3;
label:
v = v & -268435456;
if v != 0 goto label;
return 4;
label:
return 5;
}
public static int computeVarLongSize(long)
{
long v, v, v, v, v, v, v, v, v, v;
byte v, v, v, v, v, v, v, v, v;
v := @parameter: long;
v = v & -128L;
v = v cmp 0L;
if v != 0 goto label;
return 1;
label:
v = v & -16384L;
v = v cmp 0L;
if v != 0 goto label;
return 2;
label:
v = v & -2097152L;
v = v cmp 0L;
if v != 0 goto label;
return 3;
label:
v = v & -268435456L;
v = v cmp 0L;
if v != 0 goto label;
return 4;
label:
v = v & -34359738368L;
v = v cmp 0L;
if v != 0 goto label;
return 5;
label:
v = v & -4398046511104L;
v = v cmp 0L;
if v != 0 goto label;
return 6;
label:
v = v & -562949953421312L;
v = v cmp 0L;
if v != 0 goto label;
return 7;
label:
v = v & -72057594037927936L;
v = v cmp 0L;
if v != 0 goto label;
return 8;
label:
v = v & -9223372036854775808L;
v = v cmp 0L;
if v != 0 goto label;
return 9;
label:
return 10;
}
public static int computeVarSignedIntSize(int)
{
int v, v, v;
v := @parameter: int;
v = staticinvoke <org.fusesource.hawtbuf.AbstractVarIntSupport: int encodeZigZag32(int)>(v);
v = staticinvoke <org.fusesource.hawtbuf.AbstractVarIntSupport: int computeVarIntSize(int)>(v);
return v;
}
public static int computeVarSignedLongSize(long)
{
int v;
long v, v;
v := @parameter: long;
v = staticinvoke <org.fusesource.hawtbuf.AbstractVarIntSupport: long encodeZigZag64(long)>(v);
v = staticinvoke <org.fusesource.hawtbuf.AbstractVarIntSupport: int computeVarLongSize(long)>(v);
return v;
}
}