Look closer in the thread you took the code from, it discusses ByteArrayInputStream
ByteArrayInputStream