@@ -174,7 +174,7 @@ public static boolean isWellKnownAuthType(ByteBuf metadata) {
174174 * field's value is length or unknown auth type
175175 * @throws IllegalStateException if not enough readable bytes in the given {@link ByteBuf}
176176 */
177- public static WellKnownAuthType decodeWellKnownAuthType (ByteBuf metadata ) {
177+ public static WellKnownAuthType readWellKnownAuthType (ByteBuf metadata ) {
178178 if (metadata .readableBytes () < 1 ) {
179179 throw new IllegalStateException (
180180 "Unable to decode Well Know Auth type. Not enough readable bytes" );
@@ -195,7 +195,7 @@ public static WellKnownAuthType decodeWellKnownAuthType(ByteBuf metadata) {
195195 * @param metadata
196196 * @return
197197 */
198- public static CharSequence decodeCustomAuthType (ByteBuf metadata ) {
198+ public static CharSequence readCustomAuthType (ByteBuf metadata ) {
199199 if (metadata .readableBytes () < 2 ) {
200200 throw new IllegalStateException (
201201 "Unable to decode custom Auth type. Not enough readable bytes" );
@@ -226,7 +226,7 @@ public static CharSequence decodeCustomAuthType(ByteBuf metadata) {
226226 * @return sliced {@link ByteBuf} or {@link Unpooled#EMPTY_BUFFER} if no bytes readable in the
227227 * given one
228228 */
229- public static ByteBuf decodePayload (ByteBuf metadata ) {
229+ public static ByteBuf readPayload (ByteBuf metadata ) {
230230 if (metadata .readableBytes () == 0 ) {
231231 return Unpooled .EMPTY_BUFFER ;
232232 }
@@ -242,8 +242,8 @@ public static ByteBuf decodePayload(ByteBuf metadata) {
242242 * simpleAuthMetadata#readIndex} should be set to the username length byte
243243 * @return sliced {@link ByteBuf} or {@link Unpooled#EMPTY_BUFFER} if username length is zero
244244 */
245- public static ByteBuf decodeUsername (ByteBuf simpleAuthMetadata ) {
246- short usernameLength = decodeUsernameLength (simpleAuthMetadata );
245+ public static ByteBuf readUsername (ByteBuf simpleAuthMetadata ) {
246+ short usernameLength = readUsernameLength (simpleAuthMetadata );
247247
248248 if (usernameLength == 0 ) {
249249 return Unpooled .EMPTY_BUFFER ;
@@ -260,7 +260,7 @@ public static ByteBuf decodeUsername(ByteBuf simpleAuthMetadata) {
260260 * simpleAuthMetadata#readIndex} should be set to the beginning of the password bytes
261261 * @return sliced {@link ByteBuf} or {@link Unpooled#EMPTY_BUFFER} if password length is zero
262262 */
263- public static ByteBuf decodePassword (ByteBuf simpleAuthMetadata ) {
263+ public static ByteBuf readPassword (ByteBuf simpleAuthMetadata ) {
264264 if (simpleAuthMetadata .readableBytes () == 0 ) {
265265 return Unpooled .EMPTY_BUFFER ;
266266 }
@@ -275,8 +275,8 @@ public static ByteBuf decodePassword(ByteBuf simpleAuthMetadata) {
275275 * simpleAuthMetadata#readIndex} should be set to the username length byte
276276 * @return {@code char[]} which represents UTF-8 username
277277 */
278- public static char [] decodeUsernameAsCharArray (ByteBuf simpleAuthMetadata ) {
279- short usernameLength = decodeUsernameLength (simpleAuthMetadata );
278+ public static char [] readUsernameAsCharArray (ByteBuf simpleAuthMetadata ) {
279+ short usernameLength = readUsernameLength (simpleAuthMetadata );
280280
281281 if (usernameLength == 0 ) {
282282 return EMPTY_CHARS_ARRAY ;
@@ -293,7 +293,7 @@ public static char[] decodeUsernameAsCharArray(ByteBuf simpleAuthMetadata) {
293293 * simpleAuthMetadata#readIndex} should be set to the beginning of the password bytes
294294 * @return {@code char[]} which represents UTF-8 password
295295 */
296- public static char [] decodePasswordAsCharArray (ByteBuf simpleAuthMetadata ) {
296+ public static char [] readPasswordAsCharArray (ByteBuf simpleAuthMetadata ) {
297297 if (simpleAuthMetadata .readableBytes () == 0 ) {
298298 return EMPTY_CHARS_ARRAY ;
299299 }
@@ -309,15 +309,15 @@ public static char[] decodePasswordAsCharArray(ByteBuf simpleAuthMetadata) {
309309 * simpleAuthMetadata#readIndex} should be set to the beginning of the password bytes
310310 * @return {@code char[]} which represents UTF-8 password
311311 */
312- public static char [] decodeBearerTokenAsCharArray (ByteBuf bearerAuthMetadata ) {
312+ public static char [] readBearerTokenAsCharArray (ByteBuf bearerAuthMetadata ) {
313313 if (bearerAuthMetadata .readableBytes () == 0 ) {
314314 return EMPTY_CHARS_ARRAY ;
315315 }
316316
317317 return CharByteBufUtil .readUtf8 (bearerAuthMetadata , bearerAuthMetadata .readableBytes ());
318318 }
319319
320- private static short decodeUsernameLength (ByteBuf simpleAuthMetadata ) {
320+ private static short readUsernameLength (ByteBuf simpleAuthMetadata ) {
321321 if (simpleAuthMetadata .readableBytes () < 1 ) {
322322 throw new IllegalStateException (
323323 "Unable to decode custom username. Not enough readable bytes" );
0 commit comments