@@ -24,7 +24,6 @@ public static int VarIntSize(int i)
2424 return result ;
2525 }
2626
27-
2827 public static int GetVarInt ( byte [ ] src , int offset , int [ ] dst )
2928 {
3029 int result = 0 ;
@@ -37,6 +36,7 @@ public static int GetVarInt(byte[] src, int offset, int[] dst)
3736 // Out of range
3837 throw new ArgumentOutOfRangeException ( "varint too long" ) ;
3938 }
39+
4040 // Get 7 bits from next byte
4141 b = src [ offset ++ ] ;
4242 result |= ( b & 0x7F ) << shift ;
@@ -46,7 +46,6 @@ public static int GetVarInt(byte[] src, int offset, int[] dst)
4646 return offset ;
4747 }
4848
49-
5049 public static int PutVarInt ( int v , byte [ ] sink , int offset )
5150 {
5251 uint uv = ( uint ) v ;
@@ -61,7 +60,6 @@ public static int PutVarInt(int v, byte[] sink, int offset)
6160 return offset ;
6261 }
6362
64-
6563 //public static int getVarInt(ByteBuffer src)
6664 //{
6765 // int tmp;
@@ -105,7 +103,6 @@ public static int PutVarInt(int v, byte[] sink, int offset)
105103 // return result;
106104 //}
107105
108-
109106 //public static void putVarInt(int v, ByteBuffer sink)
110107 //{
111108 // while (true)
@@ -138,6 +135,7 @@ public static int GetVarInt(Stream inputStream)
138135 // Out of range
139136 throw new ArgumentOutOfRangeException ( "varint too long" ) ;
140137 }
138+
141139 // Get 7 bits from next byte
142140 b = inputStream . ReadByte ( ) ;
143141 result |= ( b & 0x7F ) << shift ;
@@ -146,15 +144,13 @@ public static int GetVarInt(Stream inputStream)
146144 return result ;
147145 }
148146
149-
150147 public static void PutVarInt ( int v , Stream outputStream )
151148 {
152149 byte [ ] bytes = new byte [ VarIntSize ( v ) ] ;
153150 PutVarInt ( v , bytes , 0 ) ;
154151 outputStream . Write ( bytes , 0 , bytes . Length ) ;
155152 }
156153
157-
158154 public static int VarLongSize ( long v )
159155 {
160156 int result = 0 ;
@@ -167,7 +163,6 @@ public static int VarLongSize(long v)
167163 return result ;
168164 }
169165
170-
171166 //public static long GetVarLong(ByteBuffer src)
172167 //{
173168 // long tmp;
0 commit comments