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 SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()This method is guaranteed to not throw any exception.voidsetOutputFile(File output) Set the destination file in which this sample writer will write samplesvoidInstructs this sample writer to write samples on the specified output with UTG-8 encoding.voidSet 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.SampleWriterwrite
- 
Field Details- 
writeroutput writer to write samples to
 
- 
- 
Constructor Details- 
AbstractSampleWriterpublic AbstractSampleWriter()
 
- 
- 
Method Details- 
setWriterSet 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
 
- 
setOutputStreamInstructs 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
 
- 
setOutputFileSet 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
 
- 
closepublic 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.
 
-