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.String
id
private org.slf4j.Logger
log
private static int
MAX_STRING_BUILDER_SIZE
private 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.StringBuilder
getStringBuilder()
Returns aStringBuilder
that this Layout implementation can use to write the formatted log event to.void
input(byte[] b)
void
input(byte[] b, int pos, int off)
void
input(int b)
void
input(java.lang.String s)
void
input(java.nio.ByteBuffer b)
boolean
isEnabled()
void
output(byte[] b)
void
output(byte[] b, int pos, int off)
void
output(int b)
void
output(java.lang.String s)
void
output(java.nio.ByteBuffer b)
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.private void
wire(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 aStringBuilder
that 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)
-
-