package org.opendaylight.protocol.rsvp.parser.impl.subobject;
import static com.google.common.base.Preconditions.checkArgument;
-import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeShort;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
private static final int CONTENT_LENGTH = 2;
private AsNumberCaseParser() {
- throw new UnsupportedOperationException();
+ // Hidden on purpose
}
public static AsNumberCase parseSubobject(final ByteBuf buffer) throws RSVPParsingException {
.build();
}
-
public static ByteBuf serializeSubobject(final AsNumberCase asCase) {
final AsNumberSubobject asNumber = asCase.getAsNumber();
final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
checkArgument(asNumber.getAsNumber() != null, "AsNumber is mandatory.");
- writeShort(asNumber.getAsNumber().getValue().shortValue(), body);
+ body.writeShort(asNumber.getAsNumber().getValue().shortValue());
return body;
}
}