@@ -174,7 +174,7 @@ public static boolean isWellKnownAuthType(ByteBuf metadata) {
174
174
* field's value is length or unknown auth type
175
175
* @throws IllegalStateException if not enough readable bytes in the given {@link ByteBuf}
176
176
*/
177
- public static WellKnownAuthType decodeWellKnownAuthType (ByteBuf metadata ) {
177
+ public static WellKnownAuthType readWellKnownAuthType (ByteBuf metadata ) {
178
178
if (metadata .readableBytes () < 1 ) {
179
179
throw new IllegalStateException (
180
180
"Unable to decode Well Know Auth type. Not enough readable bytes" );
@@ -195,7 +195,7 @@ public static WellKnownAuthType decodeWellKnownAuthType(ByteBuf metadata) {
195
195
* @param metadata
196
196
* @return
197
197
*/
198
- public static CharSequence decodeCustomAuthType (ByteBuf metadata ) {
198
+ public static CharSequence readCustomAuthType (ByteBuf metadata ) {
199
199
if (metadata .readableBytes () < 2 ) {
200
200
throw new IllegalStateException (
201
201
"Unable to decode custom Auth type. Not enough readable bytes" );
@@ -226,7 +226,7 @@ public static CharSequence decodeCustomAuthType(ByteBuf metadata) {
226
226
* @return sliced {@link ByteBuf} or {@link Unpooled#EMPTY_BUFFER} if no bytes readable in the
227
227
* given one
228
228
*/
229
- public static ByteBuf decodePayload (ByteBuf metadata ) {
229
+ public static ByteBuf readPayload (ByteBuf metadata ) {
230
230
if (metadata .readableBytes () == 0 ) {
231
231
return Unpooled .EMPTY_BUFFER ;
232
232
}
@@ -242,8 +242,8 @@ public static ByteBuf decodePayload(ByteBuf metadata) {
242
242
* simpleAuthMetadata#readIndex} should be set to the username length byte
243
243
* @return sliced {@link ByteBuf} or {@link Unpooled#EMPTY_BUFFER} if username length is zero
244
244
*/
245
- public static ByteBuf decodeUsername (ByteBuf simpleAuthMetadata ) {
246
- short usernameLength = decodeUsernameLength (simpleAuthMetadata );
245
+ public static ByteBuf readUsername (ByteBuf simpleAuthMetadata ) {
246
+ short usernameLength = readUsernameLength (simpleAuthMetadata );
247
247
248
248
if (usernameLength == 0 ) {
249
249
return Unpooled .EMPTY_BUFFER ;
@@ -260,7 +260,7 @@ public static ByteBuf decodeUsername(ByteBuf simpleAuthMetadata) {
260
260
* simpleAuthMetadata#readIndex} should be set to the beginning of the password bytes
261
261
* @return sliced {@link ByteBuf} or {@link Unpooled#EMPTY_BUFFER} if password length is zero
262
262
*/
263
- public static ByteBuf decodePassword (ByteBuf simpleAuthMetadata ) {
263
+ public static ByteBuf readPassword (ByteBuf simpleAuthMetadata ) {
264
264
if (simpleAuthMetadata .readableBytes () == 0 ) {
265
265
return Unpooled .EMPTY_BUFFER ;
266
266
}
@@ -275,8 +275,8 @@ public static ByteBuf decodePassword(ByteBuf simpleAuthMetadata) {
275
275
* simpleAuthMetadata#readIndex} should be set to the username length byte
276
276
* @return {@code char[]} which represents UTF-8 username
277
277
*/
278
- public static char [] decodeUsernameAsCharArray (ByteBuf simpleAuthMetadata ) {
279
- short usernameLength = decodeUsernameLength (simpleAuthMetadata );
278
+ public static char [] readUsernameAsCharArray (ByteBuf simpleAuthMetadata ) {
279
+ short usernameLength = readUsernameLength (simpleAuthMetadata );
280
280
281
281
if (usernameLength == 0 ) {
282
282
return EMPTY_CHARS_ARRAY ;
@@ -293,7 +293,7 @@ public static char[] decodeUsernameAsCharArray(ByteBuf simpleAuthMetadata) {
293
293
* simpleAuthMetadata#readIndex} should be set to the beginning of the password bytes
294
294
* @return {@code char[]} which represents UTF-8 password
295
295
*/
296
- public static char [] decodePasswordAsCharArray (ByteBuf simpleAuthMetadata ) {
296
+ public static char [] readPasswordAsCharArray (ByteBuf simpleAuthMetadata ) {
297
297
if (simpleAuthMetadata .readableBytes () == 0 ) {
298
298
return EMPTY_CHARS_ARRAY ;
299
299
}
@@ -309,15 +309,15 @@ public static char[] decodePasswordAsCharArray(ByteBuf simpleAuthMetadata) {
309
309
* simpleAuthMetadata#readIndex} should be set to the beginning of the password bytes
310
310
* @return {@code char[]} which represents UTF-8 password
311
311
*/
312
- public static char [] decodeBearerTokenAsCharArray (ByteBuf bearerAuthMetadata ) {
312
+ public static char [] readBearerTokenAsCharArray (ByteBuf bearerAuthMetadata ) {
313
313
if (bearerAuthMetadata .readableBytes () == 0 ) {
314
314
return EMPTY_CHARS_ARRAY ;
315
315
}
316
316
317
317
return CharByteBufUtil .readUtf8 (bearerAuthMetadata , bearerAuthMetadata .readableBytes ());
318
318
}
319
319
320
- private static short decodeUsernameLength (ByteBuf simpleAuthMetadata ) {
320
+ private static short readUsernameLength (ByteBuf simpleAuthMetadata ) {
321
321
if (simpleAuthMetadata .readableBytes () < 1 ) {
322
322
throw new IllegalStateException (
323
323
"Unable to decode custom username. Not enough readable bytes" );
0 commit comments