- use ByteArrayOutputStream to get byte representation of frames