Class LockingStringBuilderEncoder
java.lang.Object
org.apache.logging.log4j.core.layout.LockingStringBuilderEncoder
- All Implemented Interfaces:
Encoder<StringBuilder>
Encoder for StringBuilders that locks on the ByteBufferDestination.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CharBuffer
private final Charset
private final CharsetEncoder
-
Constructor Summary
ConstructorsConstructorDescriptionLockingStringBuilderEncoder
(Charset charset) LockingStringBuilderEncoder
(Charset charset, int charBufferSize) -
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(StringBuilder source, ByteBufferDestination destination) Encodes the specified source object to some binary representation and writes the result to the specified destination.private CharBuffer
private void
logEncodeTextException
(Exception ex, StringBuilder text, ByteBufferDestination destination)
-
Field Details
-
charset
-
charsetEncoder
-
cachedCharBuffer
-
-
Constructor Details
-
LockingStringBuilderEncoder
-
LockingStringBuilderEncoder
-
-
Method Details
-
getCharBuffer
-
encode
Description copied from interface:Encoder
Encodes the specified source object to some binary representation and writes the result to the specified destination.- Specified by:
encode
in interfaceEncoder<StringBuilder>
- Parameters:
source
- the object to encode.destination
- holds the ByteBuffer to write into.
-
logEncodeTextException
private void logEncodeTextException(Exception ex, StringBuilder text, ByteBufferDestination destination)
-