public final class LoggingStreamingContent extends Object implements StreamingContent
LoggingOutputStream
.
Implementation is not thread-safe.
Constructor and Description |
---|
LoggingStreamingContent(StreamingContent content,
Logger logger,
Level loggingLevel,
int contentLoggingLimit) |
Modifier and Type | Method and Description |
---|---|
void |
writeTo(OutputStream out)
Writes the byte content to the given output stream.
|
public LoggingStreamingContent(StreamingContent content, Logger logger, Level loggingLevel, int contentLoggingLimit)
content
- streaming contentlogger
- loggerloggingLevel
- logging levelcontentLoggingLimit
- maximum number of bytes to log or 0
to avoid logging contentpublic void writeTo(OutputStream out) throws IOException
StreamingContent
Implementations must not close the output stream, and instead should flush the output stream. Some callers may assume that the output stream has not been closed, and will fail to work if it has been closed.
writeTo
in interface StreamingContent
out
- output streamIOException
Copyright © 2011–2019 Google. All rights reserved.