Public Sub WriteVarShort(ByVal int As Integer) Implements IDataWriter.WriteVarShort
Dim local_5 = 0
If int > SHORT_MAX_VALUE Or int < SHORT_MIN_VALUE Then
Throw New System.Exception("Forbidden value")
Else
Dim local_2 As BigEndianWriter = New BigEndianWriter()
If int >= 0 And int <= MASK_0 Then
local_2.WriteByte(CByte(int))
WriteBytes(local_2.Data)
Return
End If
Dim local_3 = int And 65535
Dim local_4 As BigEndianWriter = New BigEndianWriter()
While local_3 <> 0
local_4.WriteByte(CByte(local_3 And MASK_0))
local_4.Position = local_4.Data.Length - 1
Dim local_4_reader As BigEndianReader = New BigEndianReader(local_4.Data)
local_5 = local_4_reader.ReadByte()
local_4 = New BigEndianWriter(local_4_reader.Data)
local_3 = CInt(CUInt(local_3 >> CHUNCK_BIT_SIZE))
If local_3 > 0 Then
local_5 = local_5 Or MASK_1
End If
local_2.WriteByte(CByte(local_5))
End While
WriteBytes(local_2.Data)
Return
End If
End Sub