本文整理了Java中net.openhft.chronicle.bytes.Bytes.writeLimit()
方法的一些代码示例,展示了Bytes.writeLimit()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bytes.writeLimit()
方法的具体详情如下:
包路径:net.openhft.chronicle.bytes.Bytes
类名称:Bytes
方法名:writeLimit
暂无
代码示例来源:origin: OpenHFT/Chronicle-Queue
long rp = bytes.readPosition();
long wp = bytes.writePosition();
long wl = bytes.writeLimit();
documentContext.rollbackOnClose();
} finally {
bytes.readPosition(rp).writePosition(wp).writeLimit(wl);
代码示例来源:origin: net.openhft/chronicle-bytes
/**
* @return is the readPosition at the start and the writeLimit at the end.
*/
@Override
default boolean isClear() {
return start() == readPosition() && writeLimit() == capacity();
}
代码示例来源:origin: net.openhft/chronicle-bytes
@org.jetbrains.annotations.NotNull
@NotNull
public static Bytes asBytes(@org.jetbrains.annotations.NotNull @NotNull RandomDataOutput bytes, long position, long limit)
throws IllegalStateException, BufferOverflowException, BufferUnderflowException {
Bytes sbytes = bytes.bytesForWrite();
sbytes.writeLimit(limit);
sbytes.readLimit(limit);
sbytes.readPosition(position);
return sbytes;
}
代码示例来源:origin: net.openhft/chronicle-bytes
public UncheckedBytes(@NotNull Bytes underlyingBytes) throws IllegalStateException {
super(underlyingBytes.bytesStore(), underlyingBytes.writePosition(), underlyingBytes.writeLimit());
this.underlyingBytes = underlyingBytes;
readPosition(underlyingBytes.readPosition());
}
代码示例来源:origin: net.openhft/chronicle-bytes
public UncheckedNativeBytes(@NotNull Bytes<Underlying> underlyingBytes)
throws IllegalStateException {
this.underlyingBytes = underlyingBytes;
this.bytesStore = (NativeBytesStore<Underlying>) underlyingBytes.bytesStore();
assert bytesStore.start() == 0;
writePosition = underlyingBytes.writePosition();
writeLimit = underlyingBytes.writeLimit();
readPosition = underlyingBytes.readPosition();
capacity = bytesStore.capacity();
}
代码示例来源:origin: net.openhft/chronicle-bytes
Bytes<ByteBuffer> bbb = bs.bytesForWrite();
bbb.writePosition(byteBuffer.position());
bbb.writeLimit(byteBuffer.limit());
return bbb;
} finally {
代码示例来源:origin: net.openhft/chronicle-bytes
public void setBytes(@NotNull Bytes bytes) throws IllegalStateException {
BytesStore underlyingBytes = bytes.bytesStore();
if (bytesStore != underlyingBytes) {
bytesStore.release();
this.bytesStore = underlyingBytes;
bytesStore.reserve();
}
readPosition(bytes.readPosition());
this.uncheckedWritePosition(bytes.writePosition());
this.writeLimit = bytes.writeLimit();
assert !bytesStore.isDirectMemory() || BytesUtil.register(this);
this.underlyingBytes = bytes;
}
内容来源于网络,如有侵权,请联系作者删除!