Tutorial by Examples: bytearray

'Declare an array of bytes, assign multi-byte character codes, and convert to a string Dim multiByteChars(9) As Byte multiByteChars(0) = 87 multiByteChars(1) = 0 multiByteChars(2) = 111 multiByteChars(3) = 0 multiByteChars(4) = 114 multiByteChars(5) = 0 multiByteChars(6) = 108 multiByteChar...
Strings can be assigned directly to byte arrays and visa-versa. Remember that Strings are stored in a Multi-Byte Character Set (see Remarks below) so only every other index of the resulting array will be the portion of the character that falls within the ASCII range. Dim bytes() As Byte Dim exampl...
def make_unicode(data): if type(data) != unicode: data = data.decode('utf-8') return data else: return data
Animation below shows what is happening when you use IDataInput interface methods to access data form ByteArray and other classes which implement this interface.

Page 1 of 1