Add the protection to avoid data overflow in BinaryXmlSerializer.java

Add an integer overflow check in the writeShort in these two methods:
1.BinaryXmlSerializer#attributeBytesHex
2.BinaryXmlSerializer#attributeBytesBase64

Bug: 307288067
Test: atest BinaryXmlTest
Merged-In: I4e3f4881742f0e865eaefabb8ee134c67c6b53d9
Change-Id: I81f5ed43342d5b906f36f3733c2115232da90ac1
2 files changed