本文整理了Java中io.netty.buffer.ByteBuf.maxWritableBytes()
方法的一些代码示例,展示了ByteBuf.maxWritableBytes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuf.maxWritableBytes()
方法的具体详情如下:
包路径:io.netty.buffer.ByteBuf
类名称:ByteBuf
方法名:maxWritableBytes
[英]Returns the maximum possible number of writable bytes, which is equal to (this.maxCapacity - this.writerIndex).
[中]返回可能的最大可写字节数,该字节数等于(this.maxCapacity-this.writeridex)。
代码示例来源:origin: netty/netty
@Override
public final int maxWritableBytes() {
return buf.maxWritableBytes();
}
代码示例来源:origin: netty/netty
@Override
public int maxWritableBytes() {
return buf.maxWritableBytes();
}
代码示例来源:origin: redisson/redisson
@Override
public final int maxWritableBytes() {
return buf.maxWritableBytes();
}
代码示例来源:origin: redisson/redisson
@Override
public int maxWritableBytes() {
return buf.maxWritableBytes();
}
代码示例来源:origin: wildfly/wildfly
@Override
public final int maxWritableBytes() {
return buf.maxWritableBytes();
}
代码示例来源:origin: wildfly/wildfly
@Override
public int maxWritableBytes() {
return buf.maxWritableBytes();
}
代码示例来源:origin: micronaut-projects/micronaut-core
@Override
public final int maxWritableBytes() {
return byteBuf.maxWritableBytes();
}
代码示例来源:origin: netty/netty
@Override
protected int doReadBytes(ByteBuf buf) throws Exception {
final RecvByteBufAllocator.Handle allocHandle = unsafe().recvBufAllocHandle();
allocHandle.attemptedBytesRead(Math.max(1, Math.min(available(), buf.maxWritableBytes())));
return buf.writeBytes(is, allocHandle.attemptedBytesRead());
}
代码示例来源:origin: redisson/redisson
@Override
protected int doReadBytes(ByteBuf buf) throws Exception {
final RecvByteBufAllocator.Handle allocHandle = unsafe().recvBufAllocHandle();
allocHandle.attemptedBytesRead(Math.max(1, Math.min(available(), buf.maxWritableBytes())));
return buf.writeBytes(is, allocHandle.attemptedBytesRead());
}
代码示例来源:origin: wildfly/wildfly
@Override
protected int doReadBytes(ByteBuf buf) throws Exception {
final RecvByteBufAllocator.Handle allocHandle = unsafe().recvBufAllocHandle();
allocHandle.attemptedBytesRead(Math.max(1, Math.min(available(), buf.maxWritableBytes())));
return buf.writeBytes(is, allocHandle.attemptedBytesRead());
}
代码示例来源:origin: io.netty/netty-buffer
@Override
public int maxWritableBytes() {
return buf.maxWritableBytes();
}
代码示例来源:origin: io.netty/netty-buffer
@Override
public final int maxWritableBytes() {
return buf.maxWritableBytes();
}
代码示例来源:origin: resteasy/Resteasy
@Override
public void write(int b) throws IOException {
if (buffer.maxWritableBytes() < 1) {
flush();
}
buffer.writeByte(b);
}
代码示例来源:origin: resteasy/Resteasy
@Override
public void write(byte[] b, int off, int len) throws IOException {
int dataLengthLeftToWrite = len;
int dataToWriteOffset = off;
int spaceLeftInCurrentChunk;
while ((spaceLeftInCurrentChunk = buffer.maxWritableBytes()) < dataLengthLeftToWrite) {
buffer.writeBytes(b, dataToWriteOffset, spaceLeftInCurrentChunk);
dataToWriteOffset = dataToWriteOffset + spaceLeftInCurrentChunk;
dataLengthLeftToWrite = dataLengthLeftToWrite - spaceLeftInCurrentChunk;
flush();
}
if (dataLengthLeftToWrite > 0) {
buffer.writeBytes(b, dataToWriteOffset, dataLengthLeftToWrite);
}
}
代码示例来源:origin: apache/activemq-artemis
@Override
public final int maxWritableBytes() {
return buf.maxWritableBytes();
}
代码示例来源:origin: org.apache.activemq/artemis-jms-client-all
@Override
public int maxWritableBytes() {
return buf.maxWritableBytes();
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
@Override
public final int maxWritableBytes() {
return buf.maxWritableBytes();
}
代码示例来源:origin: org.apache.activemq/artemis-jms-client-all
@Override
protected int doReadBytes(ByteBuf buf) throws Exception {
final RecvByteBufAllocator.Handle allocHandle = unsafe().recvBufAllocHandle();
allocHandle.attemptedBytesRead(Math.max(1, Math.min(available(), buf.maxWritableBytes())));
return buf.writeBytes(is, allocHandle.attemptedBytesRead());
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
@Override
protected int doReadBytes(ByteBuf buf) throws Exception {
final RecvByteBufAllocator.Handle allocHandle = unsafe().recvBufAllocHandle();
allocHandle.attemptedBytesRead(Math.max(1, Math.min(available(), buf.maxWritableBytes())));
return buf.writeBytes(is, allocHandle.attemptedBytesRead());
}
代码示例来源:origin: apache/activemq-artemis
@Override
protected int doReadBytes(ByteBuf buf) throws Exception {
final RecvByteBufAllocator.Handle allocHandle = unsafe().recvBufAllocHandle();
allocHandle.attemptedBytesRead(Math.max(1, Math.min(available(), buf.maxWritableBytes())));
return buf.writeBytes(is, allocHandle.attemptedBytesRead());
}
内容来源于网络,如有侵权,请联系作者删除!