Class FileContentReader

java.lang.Object
i5.las2peer.tools.FileContentReader

public class FileContentReader extends Object
A simple reader for string contents of a file or input stream.
  • Constructor Details

    • FileContentReader

      public FileContentReader()
  • Method Details

    • read

      public static String read(String filename) throws IOException
      Gets the content of a file as String
      Parameters:
      filename - The filename to read from
      Returns:
      Returns the content of the given file as String
      Throws:
      IOException
    • read

      public static String read(File file) throws IOException
      get the contents of a file as String
      Parameters:
      file -
      Returns:
      contents of the given file as String
      Throws:
      IOException
    • read

      public static String read(InputStream is) throws IOException
      read the content of a Stream and return it as String
      Parameters:
      is -
      Returns:
      contents of the given Stream as String
      Throws:
      IOException