code: protected BufferedInputStream buffer(final InputStream inputStream) {
          // reject null early on rather than waiting for IO operation to fail
          if (inputStream == null) { // not checked by BufferedInputStream
              throw new NullPointerException("inputStream == null");
          }
          return inputStream instanceof BufferedInputStream ? (BufferedInputStream) inputStream
                  : new BufferedInputStream(inputStream);
      }
docs: stolen from commons-io IOUtiles (@since v2.5)