Class StreamUtils


  • public abstract class StreamUtils
    extends java.lang.Object
    Utils to deal with Streams.
    • Constructor Summary

      Constructors 
      Constructor Description
      StreamUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getGzipStreamContents​(java.io.InputStream is)
      Return String content from a gzip stream
      static java.lang.String getStreamContents​(java.io.InputStream is)
      Returns the stream contents as an UTF-8 encoded string
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StreamUtils

        public StreamUtils()
    • Method Detail

      • getStreamContents

        public static java.lang.String getStreamContents​(java.io.InputStream is)
                                                  throws java.io.IOException
        Returns the stream contents as an UTF-8 encoded string
        Parameters:
        is - input stream
        Returns:
        string contents
        Throws:
        java.io.IOException - in any. SocketTimeout in example
      • getGzipStreamContents

        public static java.lang.String getGzipStreamContents​(java.io.InputStream is)
                                                      throws java.io.IOException
        Return String content from a gzip stream
        Parameters:
        is - input stream
        Returns:
        string contents
        Throws:
        java.io.IOException - in any. SocketTimeout in example