public void serialize(LittleEndianOutput out) {String username = getUsername();boolean is16bit = StringUtil.hasMultibyte(username);out.writeShort(username.length());out.writeByte(is16bit ? 0x01 : 0x00);if (is16bit) {StringUtil.putUnicodeLE(username, out);} else {StringUtil.putCompressedUnicode(username, out);}int encodedByteCount = 3 + username.length() * (is16bit ? 2 : 1);int paddingSize = DATA_SIZE - encodedByteCount;out.write(PADDING, 0, paddingSize);}
public override void Serialize(ILittleEndianOutput out1){String username = Username;bool is16bit = StringUtil.HasMultibyte(username);out1.WriteShort(username.Length);out1.WriteByte(is16bit ? 0x01 : 0x00);if (is16bit){StringUtil.PutUnicodeLE(username, out1);}else{StringUtil.PutCompressedUnicode(username, out1);}int encodedByteCount = 3 + username.Length * (is16bit ? 2 : 1);int paddingSize = DATA_SIZE - encodedByteCount;out1.Write(PADDING, 0, paddingSize);}