Class IoUtils


  • public final class IoUtils
    extends Object
    • Method Detail

      • readAllToBytes

        public static byte[] readAllToBytes​(InputStream in)
                                     throws IOException
        Reads the entire InputStream to EOF and returns the data as bytes.
        Parameters:
        in - the stream to read.
        Returns:
        the read data as bytes.
        Throws:
        IOException - in the event the data cannot be read.
      • readAllToString

        public static String readAllToString​(InputStream in)
                                      throws IOException
        Reads the entire InputStream to EOF and returns the data as a string.
        Parameters:
        in - the stream to read.
        Returns:
        the read data as a string.
        Throws:
        IOException - in the event the data cannot be read.