avoid array copy unless necessary, to improve performance
mark InputStream.read as blocking