Package org.apache.hc.client5.http.impl
Class Wire
- java.lang.Object
-
- org.apache.hc.client5.http.impl.Wire
-
@Internal public class Wire extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringidprivate org.slf4j.Loggerlogprivate static intMAX_STRING_BUILDER_SIZEprivate static java.lang.ThreadLocal<java.lang.StringBuilder>THREAD_LOCAL
-
Constructor Summary
Constructors Constructor Description Wire(org.slf4j.Logger log, java.lang.String id)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.StringBuildergetStringBuilder()Returns aStringBuilderthat this Layout implementation can use to write the formatted log event to.voidinput(byte[] b)voidinput(byte[] b, int pos, int off)voidinput(int b)voidinput(java.lang.String s)voidinput(java.nio.ByteBuffer b)booleanisEnabled()voidoutput(byte[] b)voidoutput(byte[] b, int pos, int off)voidoutput(int b)voidoutput(java.lang.String s)voidoutput(java.nio.ByteBuffer b)private static voidtrimToMaxSize(java.lang.StringBuilder stringBuilder, int maxSize)Ensures that the char[] array of the specified StringBuilder does not exceed the specified number of characters.private voidwire(java.lang.String header, byte[] b, int pos, int off)
-
-
-
Field Detail
-
MAX_STRING_BUILDER_SIZE
private static final int MAX_STRING_BUILDER_SIZE
- See Also:
- Constant Field Values
-
THREAD_LOCAL
private static final java.lang.ThreadLocal<java.lang.StringBuilder> THREAD_LOCAL
-
log
private final org.slf4j.Logger log
-
id
private final java.lang.String id
-
-
Method Detail
-
getStringBuilder
private static java.lang.StringBuilder getStringBuilder()
Returns aStringBuilderthat this Layout implementation can use to write the formatted log event to.- Returns:
- a
StringBuilder
-
trimToMaxSize
private static void trimToMaxSize(java.lang.StringBuilder stringBuilder, int maxSize)Ensures that the char[] array of the specified StringBuilder does not exceed the specified number of characters. This method is useful to ensure that excessively long char[] arrays are not kept in memory forever.- Parameters:
stringBuilder- the StringBuilder to checkmaxSize- the maximum number of characters the StringBuilder is allowed to have
-
wire
private void wire(java.lang.String header, byte[] b, int pos, int off)
-
isEnabled
public boolean isEnabled()
-
output
public void output(byte[] b, int pos, int off)
-
input
public void input(byte[] b, int pos, int off)
-
output
public void output(byte[] b)
-
input
public void input(byte[] b)
-
output
public void output(int b)
-
input
public void input(int b)
-
output
public void output(java.lang.String s)
-
input
public void input(java.lang.String s)
-
output
public void output(java.nio.ByteBuffer b)
-
input
public void input(java.nio.ByteBuffer b)
-
-