use ByteArrayInputStream

A small change to remove the use of deprecated API by switching to use
ByteArrayInputStream