public class StreamWriter extends DataWriter
Modifier and Type | Class and Description |
---|---|
static class |
StreamWriter.Format |
DataEndpoint.State
lastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEY
BUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZE
id, log, name, TIMESTAMP_FORMAT
Constructor and Description |
---|
StreamWriter(File file) |
StreamWriter(OutputStream outputStream) |
StreamWriter(Writer writer) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Indicates that this endpoint has finished reading or writing.
|
boolean |
getCloseStream() |
StreamWriter.Format |
getFormat() |
static StreamWriter |
newJsonSystemOutWriter()
Creates a new instance of StreamWriter writing JSON to System.out.
|
static StreamWriter |
newSystemErrWriter()
Creates a new instance of StreamWriter writing to System.err.
|
static StreamWriter |
newSystemOutWriter()
Creates a new instance of StreamWriter writing to System.out.
|
static StreamWriter |
newSystemOutWriterWithSessionProperties()
Creates a new instance of StreamWriter writing to System.out with all session properties.
|
static StreamWriter |
newXmlSystemOutWriter()
Creates a new instance of StreamWriter writing XML to System.out.
|
void |
open()
Makes this endpoint ready for reading or writing.
|
StreamWriter |
setCloseStream(boolean closeStream)
Specifies if the stream should be closed when this writer is closed (default is false).
|
StreamWriter |
setFormat(StreamWriter.Format format) |
protected void |
writeImpl(Record record)
Overridden by subclasses to write the specified record to this
DataWriter . |
addExceptionProperties, available, getNestedEndpoint, getNestedWriter, getRootEndpoint, getRootWriter, write
decrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, resetRecordCount, toString
addElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescription
public StreamWriter(File file) throws DataException
DataException
public StreamWriter(Writer writer)
public StreamWriter(OutputStream outputStream)
public static StreamWriter newSystemOutWriter()
public static StreamWriter newJsonSystemOutWriter()
public static StreamWriter newXmlSystemOutWriter()
public static StreamWriter newSystemErrWriter()
public static StreamWriter newSystemOutWriterWithSessionProperties()
public StreamWriter.Format getFormat()
public StreamWriter setFormat(StreamWriter.Format format)
public boolean getCloseStream()
public StreamWriter setCloseStream(boolean closeStream)
closeStream
- public void open() throws DataException
DataEndpoint
open
in class DataEndpoint
DataException
public void close() throws DataException
DataEndpoint
close
in class DataEndpoint
DataException
protected void writeImpl(Record record) throws Throwable
DataWriter
DataWriter
.writeImpl
in class DataWriter
Throwable
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.