code: public static InputStream asBufferedInputStream(InputStream is) {
          if (is instanceof BufferedInputStream || is instanceof ByteArrayInputStream) {
              return is;
          }
          return new BufferedInputStream(is);
      }
docs: Ensures that the returned stream is a buffered version of the supplied input stream. The result must not
  necessarily be an instance of {@link BufferedInputStream}, it can also be, e.g., a {@link ByteArrayInputStream},
  depending on the type of the supplied input stream.
  
  @param is
  the input stream
  
  @return a buffered version of {@code is}