public static DataInputStream wrapInputStream ( InputStream is , int bufferSize , int readBufferSize ) { // wrapping BufferedByteInputStream in BufferedInputStream decreases // pressure on BBIS internal locks, and we read from the BBIS in // bigger chunks return new DataInputStream ( new BufferedInputStream ( new BufferedByteInputStream ( is , bufferSize , readBufferSize ) ) ) ; }
Wrap given input stream with BufferedByteInputOutput . This is the only way to instantiate the buffered input stream .