import io.netty.buffer.ByteBuf;
public final class AttributeUtil {
-
- private static final int MAX_ATTR_LENGTH_FOR_SINGLE_BYTE = 255;
-
public static final int OPTIONAL = 128;
public static final int TRANSITIVE = 64;
public static final int PARTIAL = 32;
private static final int EXTENDED = 16;
private AttributeUtil() {
+ // Hidden on purpose
}
/**
*/
public static void formatAttribute(final int flags, final int type, final ByteBuf value, final ByteBuf buffer) {
final int length = value.writerIndex();
- final boolean extended = length > MAX_ATTR_LENGTH_FOR_SINGLE_BYTE ? true : false;
+ final boolean extended = length > 255;
buffer.writeByte(extended ? flags | EXTENDED : flags);
buffer.writeByte(type);
if (extended) {