@@ -29,7 +29,7 @@ public class Utf8ByteBufCharsetDecoder {
29
29
private static final int UTF_8_MAX_BYTES_PER_CHAR = 4 ;
30
30
private static final char INVALID_CHAR_REPLACEMENT = '�' ;
31
31
32
- private static final ThreadLocal <Utf8ByteBufCharsetDecoder > POOL = ThreadLocal .withInitial (() -> new Utf8ByteBufCharsetDecoder () );
32
+ private static final ThreadLocal <Utf8ByteBufCharsetDecoder > POOL = ThreadLocal .withInitial (Utf8ByteBufCharsetDecoder :: new );
33
33
private final CharsetDecoder decoder = configureReplaceCodingErrorActions (UTF_8 .newDecoder ());
34
34
protected CharBuffer charBuffer = allocateCharBuffer (INITIAL_CHAR_BUFFER_SIZE );
35
35
private ByteBuffer splitCharBuffer = ByteBuffer .allocate (UTF_8_MAX_BYTES_PER_CHAR );
@@ -161,14 +161,14 @@ protected void decodePartial(ByteBuffer nioBuffer, boolean endOfInput) {
161
161
}
162
162
}
163
163
164
- private void decode (ByteBuffer [] nioBuffers , int length ) {
164
+ private void decode (ByteBuffer [] nioBuffers ) {
165
165
int count = nioBuffers .length ;
166
166
for (int i = 0 ; i < count ; i ++) {
167
167
decodePartial (nioBuffers [i ].duplicate (), i == count - 1 );
168
168
}
169
169
}
170
170
171
- private void decodeSingleNioBuffer (ByteBuffer nioBuffer , int length ) {
171
+ private void decodeSingleNioBuffer (ByteBuffer nioBuffer ) {
172
172
decoder .decode (nioBuffer , charBuffer , true );
173
173
}
174
174
@@ -181,9 +181,9 @@ public String decode(ByteBuf buf) {
181
181
ensureCapacity (length );
182
182
183
183
if (buf .nioBufferCount () == 1 ) {
184
- decodeSingleNioBuffer (buf .internalNioBuffer (buf .readerIndex (), length ).duplicate (), length );
184
+ decodeSingleNioBuffer (buf .internalNioBuffer (buf .readerIndex (), length ).duplicate ());
185
185
} else {
186
- decode (buf .nioBuffers (), buf . readableBytes () );
186
+ decode (buf .nioBuffers ());
187
187
}
188
188
189
189
return charBuffer .flip ().toString ();
@@ -219,7 +219,7 @@ public String decode(ByteBuf... bufs) {
219
219
}
220
220
221
221
ensureCapacity (totalSize );
222
- decode (nioBuffers , totalSize );
222
+ decode (nioBuffers );
223
223
224
224
return charBuffer .flip ().toString ();
225
225
}
0 commit comments