dim b() as byte = {1,2}
dim s as int16
dim p as IntPtr
p = System.Runtime.InteropServices.Marshal.AllocHGlobal(2)
System.Runtime.InteropServices.Marshal.WriteByte(p, b(1))
System.Runtime.InteropServices.Marshal.WriteByte(p, 1, b(0))
s = System.Runtime.InteropServices.Marshal.ReadInt16(p)
System.Runtime.InteropServices.Marshal.FreeHGlobal(p)