/** * Returns whether the lease flag is set. * * @return whether the lease flag is set */ public boolean isLeaseFlagSet() { return isFlagSet(FLAG_LEASE); }
private int getResumeIdentificationTokenOffset() { if (isFlagSet(FLAG_RESUME_ENABLED)) { return OFFSET_RESUME_IDENTIFICATION_TOKEN_LENGTH + Short.BYTES; } else { return OFFSET_RESUME_IDENTIFICATION_TOKEN_LENGTH; } } }
private int getResumeIdentificationTokenLength() { if (isFlagSet(FLAG_RESUME_ENABLED)) { return getByteBuf().getUnsignedShort(OFFSET_RESUME_IDENTIFICATION_TOKEN_LENGTH); } else { return 0; } }
/** * Returns the resume identification token directly. If the Resume Enabled flag is not set, * returns {@code null}. * * <p><b>Note:</b> this resume identification token will be outside of the {@link Frame}'s * lifecycle and may be released at any time. It is highly recommended that you {@link * ByteBuf#retain()} the resume identification token if you store it. * * @return the resume identification token directly, or {@code null} if the Resume Enabled flag is * not set * @see #mapResumeIdentificationToken(Function) */ public @Nullable ByteBuf getUnsafeResumeIdentificationToken() { if (!isFlagSet(FLAG_RESUME_ENABLED)) { return null; } ByteBuf byteBuf = getByteBuf(); return byteBuf.slice( getResumeIdentificationTokenOffset(), getResumeIdentificationTokenLength()); }
private int getResumeIdentificationTokenOffset() { if (isFlagSet(FLAG_RESUME_ENABLED)) { return OFFSET_RESUME_IDENTIFICATION_TOKEN_LENGTH + Short.BYTES; } else { return OFFSET_RESUME_IDENTIFICATION_TOKEN_LENGTH; } } }
/** * Returns whether the lease flag is set. * * @return whether the lease flag is set */ public boolean isLeaseFlagSet() { return isFlagSet(FLAG_LEASE); }
private int getResumeIdentificationTokenLength() { if (isFlagSet(FLAG_RESUME_ENABLED)) { return getByteBuf().getUnsignedShort(OFFSET_RESUME_IDENTIFICATION_TOKEN_LENGTH); } else { return 0; } }
/** * Returns the resume identification token directly. If the Resume Enabled flag is not set, * returns {@code null}. * * <p><b>Note:</b> this resume identification token will be outside of the {@link Frame}'s * lifecycle and may be released at any time. It is highly recommended that you {@link * ByteBuf#retain()} the resume identification token if you store it. * * @return the resume identification token directly, or {@code null} if the Resume Enabled flag is * not set * @see #mapResumeIdentificationToken(Function) */ public @Nullable ByteBuf getUnsafeResumeIdentificationToken() { if (!isFlagSet(FLAG_RESUME_ENABLED)) { return null; } ByteBuf byteBuf = getByteBuf(); return byteBuf.slice( getResumeIdentificationTokenOffset(), getResumeIdentificationTokenLength()); }