ByteArrayInputStream will read byte array as input stream. This class consists an internal buffer which uses to read the byte array as a stream. Also the ByteArrayInputStream buffer grows according to the data.