java.io.Closeable
, java.io.Flushable
, java.lang.AutoCloseable
, FlushableCloseable
, Protectable
ConsoleHandler
, FileHandler
public class OutputStreamHandler extends WriterHandler
OutputStream
, using the specified encoding. If no encoding is
specified, the platform default is used.handlers, handlersUpdater
outputLock
Constructor | Description |
---|---|
OutputStreamHandler() |
Construct a new instance with no formatter.
|
OutputStreamHandler(java.io.OutputStream outputStream,
java.util.logging.Formatter formatter) |
Construct a new instance.
|
OutputStreamHandler(java.util.logging.Formatter formatter) |
Construct a new instance.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
getEncoding() |
Get the target encoding.
|
void |
setEncoding(java.lang.String encoding) |
Set the target encoding.
|
void |
setOutputStream(java.io.OutputStream outputStream) |
Set the output stream to write to.
|
void |
setWriter(java.io.Writer writer) |
Set the writer.
|
addHandler, checkAccess, checkAccess, clearHandlers, disableAccess, enableAccess, getHandlers, isAutoFlush, isCallerCalculationRequired, isCloseChildren, isEnabled, protect, publish, publish, removeHandler, setAutoFlush, setCloseChildren, setEnabled, setErrorManager, setFilter, setFormatter, setHandlers, setLevel, unprotect
getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError
public OutputStreamHandler()
public OutputStreamHandler(java.util.logging.Formatter formatter)
formatter
- the formatter to usepublic OutputStreamHandler(java.io.OutputStream outputStream, java.util.logging.Formatter formatter)
outputStream
- the output stream to useformatter
- the formatter to usepublic java.lang.String getEncoding()
getEncoding
in class java.util.logging.Handler
null
if the platform default is being usedpublic void setEncoding(java.lang.String encoding) throws java.lang.SecurityException, java.io.UnsupportedEncodingException
setEncoding
in class ExtHandler
encoding
- the new encodingjava.lang.SecurityException
- if you do not have sufficient permission to invoke this operationjava.io.UnsupportedEncodingException
- if the specified encoding is not supportedpublic void setWriter(java.io.Writer writer)
setWriter
in class WriterHandler
writer
- the new writer, or null
to disable loggingpublic void setOutputStream(java.io.OutputStream outputStream)
outputStream
- the new output stream or null
for noneCopyright © 2018. All rights reserved.