Problemet ligger i "toString()"-kaldet:binaryStream.toString(); BinaryInputStream implementerer ikke toString() .Brug noget som dette til at læse bytes:
int ch;
//read bytes from ByteArrayInputStream using read method
while((ch = binaryStream.read()) != -1)
{
System.out.print((char)ch);
// store it to an array...
}