public class ReliableFileOutputStream extends FilterOutputStream
ReliableFileInputStream
out
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.
|
flush
public 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 Closeable
close
in interface AutoCloseable
close
in class FilterOutputStream
IOException
- If an error occurs closing the file.public File closeIntermediateFile() throws IOException
IOException
public void write(byte[] b) throws IOException
write
in class FilterOutputStream
IOException
FilterOutputStream.write(byte[])
public void write(byte[] b, int off, int len) throws IOException
write
in class FilterOutputStream
IOException
FilterOutputStream.write(byte[], int, int)
public void write(int b) throws IOException
write
in class FilterOutputStream
IOException
FilterOutputStream.write(int)
public void abort()
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.