Class StreamUtils

java.lang.Object
com.stripe.util.StreamUtils

public final class StreamUtils extends Object
  • Constructor Details

    • StreamUtils

      public StreamUtils()
  • Method Details

    • readToEnd

      public static String readToEnd(InputStream stream, Charset charset) throws IOException
      Reads the provided stream until the end and returns a string encoded with the provided charset.
      Parameters:
      stream - the stream to read
      charset - the charset to use
      Returns:
      a string with the contents of the input stream
      Throws:
      NullPointerException - if stream or charset is null
      IOException - if an I/O error occurs