Class Streams

java.lang.Object
com.flowlogix.util.Streams

public class Streams extends Object
Read String from Stream Does not close the stream afterward

Example:

var stream = new ByteArrayInputStream(input.getBytes());
String string = Streams.readString(stream);
Author:
lprimak
  • Constructor Details

    • Streams

      public Streams()
  • Method Details

    • readString

      public static String readString(InputStream stream) throws IOException
      Converts InputStream to String
      Parameters:
      stream - Stream
      Returns:
      Stream converted to String
      Throws:
      IOException
    • readString

      public static String readString(InputStream stream, Charset charset) throws IOException
      Converts InputStream to String
      Parameters:
      stream - Stream
      charset - Charset to convert with
      Returns:
      Stream converted to String
      Throws:
      IOException