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