public abstract class AbstractSampleWriter extends SampleWriter
Handles buffering and output writer replacement.
When a writer is set on the sample writer any previous writer is flushed and closed before beeing replaced by the new one.
Modifier and Type | Field and Description |
---|---|
protected PrintWriter |
writer
output writer to write samples to
|
Constructor and Description |
---|
AbstractSampleWriter() |
Modifier and Type | Method and Description |
---|---|
void |
close()
This method is guaranted to not throw any exception.
|
void |
flush() |
void |
setOutputFile(File output)
Set the destination file in which this sample writer will write samples
|
void |
setOutputStream(OutputStream out)
Instructs this sample writer to write samples on the specified output
with UTG-8 encoding.
|
void |
setWriter(Writer writer)
Set he new writer on which samples will be written by this smaple
writter.
|
write
protected PrintWriter writer
public void setWriter(Writer writer)
writer
- The destination writer where samples will be written by this
sample writerpublic void setOutputStream(OutputStream out)
SaveService.getFileEncoding(String)
out
- The output stream on which sample should be writtenpublic void setOutputFile(File output)
output
- The ouput file that will receive samples written by this
sample writterpublic void close()
public void flush()
Copyright © 1998-2016 Apache Software Foundation. All Rights Reserved.