/// <exception cref="System.IO.IOException"/> public static void TestValue(int val, int vintlen) { DataOutputBuffer buf = new DataOutputBuffer(); DataInputBuffer inbuf = new DataInputBuffer(); WritableUtils.WriteVInt(buf, val); if (Log.IsDebugEnabled()) { Log.Debug("Value = " + val); BytesWritable printer = new BytesWritable(); printer.Set(buf.GetData(), 0, buf.GetLength()); Log.Debug("Buffer = " + printer); } inbuf.Reset(buf.GetData(), 0, buf.GetLength()); Assert.Equal(val, WritableUtils.ReadVInt(inbuf)); Assert.Equal(vintlen, buf.GetLength()); Assert.Equal(vintlen, WritableUtils.GetVIntSize(val)); Assert.Equal(vintlen, WritableUtils.DecodeVIntSize(buf.GetData ()[0])); }
/// <exception cref="System.IO.IOException"/> public virtual void Write(BinaryWriter writer) { WritableUtils.WriteVInt(@out, value); }