Class LoggingStreamingContent (1.43.2)

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
Name Description
content StreamingContent

streaming content

logger Logger

logger

loggingLevel Level

logging level

contentLoggingLimit int

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
Name Description
out OutputStream
Exceptions
Type Description
IOException