|
DRAFT-b102 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.Outputs
public final class Outputs extends Object
This class consists exclusively of static methods that operate on output destinations.
The methods to write lines of text output a line terminator following
each line. The line terminator that is output is the platform line
terminator, as defined by the line.separator system property.
| Modifier and Type | Method and Description |
|---|---|
static void |
writeAllBytes(FileRef file,
byte[] bytes)
Write a byte array to a file. |
static void |
writeAllBytes(OutputStream out,
InputStream in)
Write all bytes to the given output stream from the given input stream. |
static void |
writeBytes(FileRef file,
byte[] bytes,
int off,
int len)
Writes a byte array to a file. |
static void |
writeLines(FileRef file,
Iterable<String> lines)
Writes the given lines of text to the specified file. |
static void |
writeLines(FileRef file,
Iterable<String> lines,
String csn)
Writes the given lines of text to the specified file. |
static void |
writeLines(FileRef file,
String... lines)
Writes the given lines of text to the specified file. |
static void |
writeLines(OutputStream out,
Iterable<String> lines)
Writes the given lines of text to the specified output stream. |
static void |
writeLines(OutputStream out,
Iterable<String> lines,
String csn)
Writes the given lines of text to the specified output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void writeAllBytes(FileRef file,
byte[] bytes)
throws IOException
file - the destination filebytes - the array containing the bytes to writeIOException - If an I/O error occurs
public static void writeBytes(FileRef file,
byte[] bytes,
int off,
int len)
throws IOException
file - the destination filebytes - the array containing the bytes to writeoff - the start offset in the datalen - the number of bytes to writeIndexOutOfBoundsException - If off or len is negative, or off+len
is greater than the length of the arrayIOException - If an I/O error occurs
public static void writeAllBytes(OutputStream out,
InputStream in)
throws IOException
out - the output stream to write toin - the input stream to read fromIOException - If an I/O error occurs when reading or writing
public static void writeLines(FileRef file,
Iterable<String> lines,
String csn)
throws IOException
Charset. When all
lines have been written, or an I/O error occurs, then the file is closed.
file - The filelines - The list of lines to write (in order)csn - the name of the charset to be usedIllegalArgumentException - if the charset name is illegal or not available in this instance
of the Java virtual machineUnmappableCharacterException - Where a line contains a character that cannot be mapped to an
output byte sequenceIOException - If an I/O error occurs
public static void writeLines(FileRef file,
Iterable<String> lines)
throws IOException
file - The filelines - The list of lines to write (in order)UnmappableCharacterException - Where a line contains a character that cannot be mapped to an
output byte sequenceIOException - If an I/O error occurs
public static void writeLines(FileRef file,
String... lines)
throws IOException
file - The filelines - The array of lines to write (in order)UnmappableCharacterException - Where a line contains a character that cannot be mapped to an
output byte sequenceIOException - If an I/O error occurs
public static void writeLines(OutputStream out,
Iterable<String> lines,
String csn)
throws IOException
out - The output streamlines - The list of lines to write (in order)csn - the name of the charset to be usedIllegalArgumentException - if the charset name is illegal or not available in this instance
of the Java virtual machineUnmappableCharacterException - Where a line contains a character that cannot be mapped to an
output byte sequenceIOException - If an I/O error occurs
public static void writeLines(OutputStream out,
Iterable<String> lines)
throws IOException
out - The output streamlines - The list of lines to write (in order)UnmappableCharacterException - Where a line contains a character that cannot be mapped to an
output byte sequenceIOException - If an I/O error occurs
|
DRAFT-b102 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||