public class ReliableFileOutputStream extends FilterOutputStream
ReliableFileInputStreamout| Constructor and Description |
|---|
ReliableFileOutputStream(File file)
Constructs a new ReliableFileOutputStream on the File
file. |
ReliableFileOutputStream(File file,
boolean append)
Constructs a new ReliableFileOutputStream on the File
file. |
ReliableFileOutputStream(String name)
Constructs a new ReliableFileOutputStream on the file named
name. |
ReliableFileOutputStream(String name,
boolean append)
Constructs a new ReliableFileOutputStream on the file named
name. |
| Modifier and Type | Method and Description |
|---|---|
void |
abort() |
void |
close()
Closes this output stream and releases any system resources
associated with this stream.
|
File |
closeIntermediateFile() |
void |
write(byte[] b)
Override default FilterOutputStream method.
|
void |
write(byte[] b,
int off,
int len)
Override default FilterOutputStream method.
|
void |
write(int b)
Override default FilterOutputStream method.
|
flushpublic ReliableFileOutputStream(File file) throws IOException
file. If the
file exists, it is written over. See the constructor which can append to
the file if so desired.file - the File on which to stream reads.IOException - If an error occurs opening the file.public ReliableFileOutputStream(File file, boolean append) throws IOException
file.file - the File on which to stream reads.append - a boolean indicating whether or not to append to an existing file.IOException - If an error occurs opening the file.public ReliableFileOutputStream(String name) throws IOException
name. If
the file exists, it is written over. See the constructor which can append to
the file if so desired.
The name may be absolute or relative
to the System property "user.dir".name - the file on which to stream writes.IOException - If an error occurs opening the file.public ReliableFileOutputStream(String name, boolean append) throws IOException
name.
The name may be absolute or relative
to the System property "user.dir".name - the file on which to stream writes.append - a boolean indicating whether or not to append to an existing file.IOException - If an error occurs opening the file.public void close()
throws IOException
close
is that it closes the output stream. A closed stream cannot perform
output operations and cannot be reopened.close in interface Closeableclose in interface AutoCloseableclose in class FilterOutputStreamIOException - If an error occurs closing the file.public File closeIntermediateFile() throws IOException
IOExceptionpublic void write(byte[] b)
throws IOException
write in class FilterOutputStreamIOExceptionFilterOutputStream.write(byte[])public void write(byte[] b,
int off,
int len)
throws IOException
write in class FilterOutputStreamIOExceptionFilterOutputStream.write(byte[], int, int)public void write(int b)
throws IOException
write in class FilterOutputStreamIOExceptionFilterOutputStream.write(int)public void abort()
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.