Class LoggingStreamingContent (1.42.3)

public final class LoggingStreamingContent implements StreamingContent

Wraps another streaming content without modifying the content, but also logging content using LoggingOutputStream.

Implementation is not thread-safe.

Inheritance

java.lang.Object > LoggingStreamingContent

Implements

StreamingContent

Constructors

LoggingStreamingContent(StreamingContent content, Logger logger, Level loggingLevel, int contentLoggingLimit)

public LoggingStreamingContent(StreamingContent content, Logger logger, Level loggingLevel, int contentLoggingLimit)
Parameters
NameDescription
contentStreamingContent

streaming content

loggerLogger

logger

loggingLevelLevel

logging level

contentLoggingLimitint

maximum number of bytes to log or 0 to avoid logging content

Methods

writeTo(OutputStream out)

public void writeTo(OutputStream out)

Writes the byte content to the given output stream.

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.

Parameter
NameDescription
outOutputStream
Exceptions
TypeDescription
IOException