Package org.apache.jmeter.report.core
Class AbstractSampleWriter
java.lang.Object
org.apache.jmeter.report.core.SampleWriter
org.apache.jmeter.report.core.AbstractSampleWriter
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
CsvSampleWriter
Base class for implementing sample writer.
Handles buffering and output writer replacement.
When a writer is set on the sample writer any previous writer is flushed and closed before being replaced by the new one.
- Since:
- 3.0
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
This method is guaranteed to not throw any exception.void
setOutputFile
(File output) Set the destination file in which this sample writer will write samplesvoid
Instructs this sample writer to write samples on the specified output with UTG-8 encoding.void
Set the new writer on which samples will be written by this sample writer.
If any writer exists on the sample writer, it is flushed and closed before being replaced by the new one.Methods inherited from class org.apache.jmeter.report.core.SampleWriter
write
-
Field Details
-
writer
output writer to write samples to
-
-
Constructor Details
-
AbstractSampleWriter
public AbstractSampleWriter()
-
-
Method Details
-
setWriter
Set the new writer on which samples will be written by this sample writer.
If any writer exists on the sample writer, it is flushed and closed before being replaced by the new one.- Parameters:
newWriter
- The destination writer where samples will be written by this sample writer
-
setOutputStream
Instructs this sample writer to write samples on the specified output with UTG-8 encoding. The encoding can be overridden by the user throughSaveService.getFileEncoding(String)
- Parameters:
out
- The output stream on which sample should be written
-
setOutputFile
Set the destination file in which this sample writer will write samples- Parameters:
output
- The output file that will receive samples written by this sample writer
-
close
public void close()This method is guaranteed to not throw any exception. If writer is already closed then does nothing.
Any buffered data is flushed by this method.
-