本文整理了Java中io.rsocket.Frame.isFlagSet()
方法的一些代码示例,展示了Frame.isFlagSet()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Frame.isFlagSet()
方法的具体详情如下:
包路径:io.rsocket.Frame
类名称:Frame
方法名:isFlagSet
暂无
代码示例来源:origin: rsocket/rsocket-java
@Override
public boolean hasMetadata() {
return Frame.isFlagSet(getFlags(), FLAGS_M);
}
代码示例来源:origin: rsocket/rsocket-java
@Override
public boolean hasMetadata() {
return Frame.isFlagSet(this.flags(), FLAGS_M);
}
代码示例来源:origin: rsocket/rsocket-java
public boolean willClientHonorLease() {
return Frame.isFlagSet(getFlags(), SetupFrameFlyweight.FLAGS_WILL_HONOR_LEASE);
}
代码示例来源:origin: rsocket/rsocket-java
public static int encode(
final ByteBuf byteBuf,
final int streamId,
int flags,
final FrameType type,
final int initialRequestN,
final @Nullable ByteBuf metadata,
final ByteBuf data) {
if (Frame.isFlagSet(flags, FrameHeaderFlyweight.FLAGS_M) != (metadata != null)) {
throw new IllegalArgumentException("metadata flag set incorrectly");
}
final int frameLength =
computeFrameLength(
type, metadata != null ? metadata.readableBytes() : null, data.readableBytes());
int length =
FrameHeaderFlyweight.encodeFrameHeader(byteBuf, frameLength, flags, type, streamId);
byteBuf.setInt(INITIAL_REQUEST_N_FIELD_OFFSET, initialRequestN);
length += Integer.BYTES;
length += FrameHeaderFlyweight.encodeMetadata(byteBuf, type, length, metadata);
length += FrameHeaderFlyweight.encodeData(byteBuf, length, data);
return length;
}
代码示例来源:origin: rsocket/rsocket-java
public static int encode(
final ByteBuf byteBuf,
final int streamId,
final int flags,
final FrameType type,
final @Nullable ByteBuf metadata,
final ByteBuf data) {
if (Frame.isFlagSet(flags, FrameHeaderFlyweight.FLAGS_M) != (metadata != null)) {
throw new IllegalArgumentException("metadata flag set incorrectly");
}
if (type.hasInitialRequestN()) {
throw new AssertionError(type + " must not be encoded without initial request N");
}
final int frameLength =
computeFrameLength(
type, metadata != null ? metadata.readableBytes() : null, data.readableBytes());
int length =
FrameHeaderFlyweight.encodeFrameHeader(byteBuf, frameLength, flags, type, streamId);
length += FrameHeaderFlyweight.encodeMetadata(byteBuf, type, length, metadata);
length += FrameHeaderFlyweight.encodeData(byteBuf, length, data);
return length;
}
代码示例来源:origin: rsocket/rsocket-java
final @Nullable ByteBuf metadata,
final ByteBuf data) {
if (Frame.isFlagSet(flags, FLAGS_M) != (metadata != null)) {
throw new IllegalStateException("bad value for metadata flag");
代码示例来源:origin: io.rsocket/rsocket-core
@Override
public boolean hasMetadata() {
return Frame.isFlagSet(getFlags(), FLAGS_M);
}
代码示例来源:origin: io.rsocket/rsocket-core
@Override
public boolean hasMetadata() {
return Frame.isFlagSet(this.flags(), FLAGS_M);
}
代码示例来源:origin: io.rsocket/rsocket-core
public boolean willClientHonorLease() {
return Frame.isFlagSet(getFlags(), SetupFrameFlyweight.FLAGS_WILL_HONOR_LEASE);
}
代码示例来源:origin: io.rsocket/rsocket-core
public static int encode(
final ByteBuf byteBuf,
final int streamId,
final int flags,
final FrameType type,
final @Nullable ByteBuf metadata,
final ByteBuf data) {
if (Frame.isFlagSet(flags, FrameHeaderFlyweight.FLAGS_M) != (metadata != null)) {
throw new IllegalArgumentException("metadata flag set incorrectly");
}
if (type.hasInitialRequestN()) {
throw new AssertionError(type + " must not be encoded without initial request N");
}
final int frameLength =
computeFrameLength(
type, metadata != null ? metadata.readableBytes() : null, data.readableBytes());
int length =
FrameHeaderFlyweight.encodeFrameHeader(byteBuf, frameLength, flags, type, streamId);
length += FrameHeaderFlyweight.encodeMetadata(byteBuf, type, length, metadata);
length += FrameHeaderFlyweight.encodeData(byteBuf, length, data);
return length;
}
代码示例来源:origin: io.rsocket/rsocket-core
public static int encode(
final ByteBuf byteBuf,
final int streamId,
int flags,
final FrameType type,
final int initialRequestN,
final @Nullable ByteBuf metadata,
final ByteBuf data) {
if (Frame.isFlagSet(flags, FrameHeaderFlyweight.FLAGS_M) != (metadata != null)) {
throw new IllegalArgumentException("metadata flag set incorrectly");
}
final int frameLength =
computeFrameLength(
type, metadata != null ? metadata.readableBytes() : null, data.readableBytes());
int length =
FrameHeaderFlyweight.encodeFrameHeader(byteBuf, frameLength, flags, type, streamId);
byteBuf.setInt(INITIAL_REQUEST_N_FIELD_OFFSET, initialRequestN);
length += Integer.BYTES;
length += FrameHeaderFlyweight.encodeMetadata(byteBuf, type, length, metadata);
length += FrameHeaderFlyweight.encodeData(byteBuf, length, data);
return length;
}
代码示例来源:origin: io.rsocket/rsocket-core
final @Nullable ByteBuf metadata,
final ByteBuf data) {
if (Frame.isFlagSet(flags, FLAGS_M) != (metadata != null)) {
throw new IllegalStateException("bad value for metadata flag");
内容来源于网络,如有侵权,请联系作者删除!