本文整理了Java中io.micronaut.core.io.buffer.ByteBuffer.write()
方法的一些代码示例,展示了ByteBuffer.write()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuffer.write()
方法的具体详情如下:
包路径:io.micronaut.core.io.buffer.ByteBuffer
类名称:ByteBuffer
方法名:write
[英]Sets the specified byte at the current writerIndexand increases the writerIndex by 1 in this buffer. The 24 high-order bits of the specified value are ignored.
[中]在当前writerIndex处设置指定字节,并在此缓冲区中将writerIndex增加1。指定值的24个高位将被忽略。
代码示例来源:origin: micronaut-projects/micronaut-core
/**
* @param eventData The byte buffer
* @param attribute The attribute
* @param value The value
*/
protected void writeAttribute(ByteBuffer eventData, byte[] attribute, String value) {
if (value != null) {
eventData.write(attribute)
.write(value, defaultCharset)
.write(NEWLINE);
}
}
}
代码示例来源:origin: micronaut-projects/micronaut-core
eventData.write(DATA_PREFIX)
.write(body)
.write(NEWLINE) // Write new lines for event separation
.write(NEWLINE);
return eventData;
代码示例来源:origin: io.micronaut/http-server
/**
* @param eventData The byte buffer
* @param attribute The attribute
* @param value The value
*/
protected void writeAttribute(ByteBuffer eventData, byte[] attribute, String value) {
if (value != null) {
eventData.write(attribute)
.write(value, serverConfiguration.getDefaultCharset())
.write(NEWLINE);
}
}
}
代码示例来源:origin: io.micronaut/runtime
@Override
public <T> ByteBuffer encode(T object, ByteBufferFactory allocator) throws CodecException {
byte[] bytes = encode(object);
int len = bytes.length;
return allocator.buffer(len, len).write(bytes);
}
}
代码示例来源:origin: io.micronaut/http-server
eventData.write(DATA_PREFIX)
.write(body)
.write(NEWLINE) // Write new lines for event separation
.write(NEWLINE);
return eventData;
内容来源于网络,如有侵权,请联系作者删除!