public class StringIO extends Object
Modifier and Type | Method and Description |
---|---|
static String |
readFully(File file)
Read the entire contents of the specified file and return a
single String object containing the contents of the file.
|
static String |
readFully(InputStream stream)
Read the entire contents of the specified InputStream and return a
single String object containing the contents of the InputStream.
|
static String |
readFully(Reader reader)
Read the entire contents of the specified Reader and return a
single String object containing the contents of the InputStream.
|
static String |
readFully(String fileName)
Read the entire contents of the specified file and return a
single String object containing the contents of the file.
|
static String |
readFully(URL url)
Read the entire contents of the specified URL and return a
single String object containing the contents of the URL.
|
public static String readFully(String fileName) throws IOException
fileName
- the name of the file from which to readIOException
- if the specified file cannot be opened, or
if an I/O error occurs while reading the filepublic static String readFully(File file) throws IOException
file
- a File from which to readIOException
- if the specified file cannot be opened, or
if an I/O error occurs while reading the filepublic static String readFully(URL url) throws IOException
url
- a URL from which to readIOException
- if the specified URL cannot be opened, or
if an I/O error occurs while reading the URLpublic static String readFully(InputStream stream) throws IOException
stream
- an InputStream from which to readIOException
- if an I/O error occurs while reading the input streampublic static String readFully(Reader reader) throws IOException
reader
- a Reader from which to readIOException
- if an I/O error occurs while reading the input streamCopyright © 2016–2022 SciJava. All rights reserved.