Added function to get bytearray