本文整理了Java中net.openhft.chronicle.bytes.Bytes.realCapacity()
方法的一些代码示例,展示了Bytes.realCapacity()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bytes.realCapacity()
方法的具体详情如下:
包路径:net.openhft.chronicle.bytes.Bytes
类名称:Bytes
方法名:realCapacity
暂无
代码示例来源:origin: OpenHFT/Chronicle-Queue
long result = batchAppenderNative.writeMessages(bytes.addressForWrite(0), bytes.realCapacity(), 1);
代码示例来源:origin: net.openhft/chronicle-map
@Override
public DataAccess<T> copy() {
return new ExternalizableDataAccess<>(tClass, bytes.realCapacity());
}
代码示例来源:origin: net.openhft/chronicle-map
@Override
public DataAccess<T> copy() {
return new SerializableDataAccess<>(bytes.realCapacity());
}
代码示例来源:origin: net.openhft/chronicle-map
@Override
public DataAccess<T> copy() {
return new BytesMarshallableDataAccess<>(tClass(), bytes.realCapacity());
}
}
代码示例来源:origin: net.openhft/chronicle-map
@Override
public DataAccess<T> copy() {
return new ExternalBytesMarshallableDataAccess<>(
tClass(), copyIfNeeded(reader), copyIfNeeded(writer), bytes.realCapacity());
}
代码示例来源:origin: net.openhft/chronicle-map
@Override
public DataAccess<T> copy() {
return new SizedMarshallableDataAccess<>(
tClass(), copyIfNeeded(sizedReader), copyIfNeeded(sizedWriter),
bytes.realCapacity());
}
代码示例来源:origin: net.openhft/chronicle-bytes
@org.jetbrains.annotations.NotNull
@NotNull
default S writeSome(@org.jetbrains.annotations.NotNull @NotNull Bytes bytes) {
try {
long length = Math.min(bytes.readRemaining(), writeRemaining());
if (length + writePosition() >= 1 << 20)
length = Math.min(bytes.readRemaining(), realCapacity() - writePosition());
write(bytes, bytes.readPosition(), length);
if (length == bytes.readRemaining()) {
bytes.clear();
} else {
bytes.readSkip(length);
if (bytes.writePosition() > bytes.realCapacity() / 2)
bytes.compact();
}
return (S) this;
} catch (BufferOverflowException | BufferUnderflowException | IllegalArgumentException e) {
throw new AssertionError(e);
}
}
代码示例来源:origin: net.openhft/chronicle-bytes
@Override
@NotNull
public NativeBytes writeSome(@NotNull Bytes bytes) {
try {
long length = Math.min(bytes.readRemaining(), writeRemaining());
if (length + writePosition() >= 1 << 20)
length = Math.min(bytes.readRemaining(), realCapacity() - writePosition());
long offset = bytes.readPosition();
long position = writePosition();
ensureCapacity(position + length);
optimisedWrite(bytes, offset, length);
if (length == bytes.readRemaining()) {
bytes.clear();
} else {
bytes.readSkip(length);
if (bytes.writePosition() > bytes.realCapacity() / 2)
bytes.compact();
}
return this;
} catch (IllegalArgumentException | BufferUnderflowException | BufferOverflowException e) {
throw new AssertionError(e);
}
}
内容来源于网络,如有侵权,请联系作者删除!