本文整理汇总了Java中io.netty.buffer.ByteBufOutputStream.writeInt方法的典型用法代码示例。如果您正苦于以下问题:Java ByteBufOutputStream.writeInt方法的具体用法?Java ByteBufOutputStream.writeInt怎么用?Java ByteBufOutputStream.writeInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.netty.buffer.ByteBufOutputStream
的用法示例。
在下文中一共展示了ByteBufOutputStream.writeInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toBytes
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf)
{
ByteBufOutputStream output = new ByteBufOutputStream(buf);
try
{
output.writeUTF(this.filename);
output.writeInt(this.frames.size());
for (Frame frame : this.frames)
{
frame.toBytes(output);
}
}
catch (IOException e)
{
e.printStackTrace();
}
}
示例2: write
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void write(ByteBufOutputStream byteBuf) throws IOException {
byteBuf.writeBoolean(this.ok);
byteBuf.writeInt(this.minPort);
byteBuf.writeInt(this.maxPort);
byteBuf.writeUTF(this.resources);
}
示例3: toBytes
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf)
{
ByteBufOutputStream stream = new ByteBufOutputStream(buf);
try
{
stream.writeInt(this.skins.size());
/* Write skins */
for (Map.Entry<String, Map<String, ByteBuf>> entry : this.skins.entrySet())
{
stream.writeUTF(entry.getKey());
stream.writeInt(entry.getValue().size());
for (Map.Entry<String, ByteBuf> skin : entry.getValue().entrySet())
{
ByteBuf buffer = skin.getValue();
stream.writeUTF(skin.getKey());
buf.writeInt(buffer.readableBytes());
buf.writeBytes(buffer);
}
}
stream.writeInt(this.models.size());
/* Write models */
for (Map.Entry<String, String> model : this.models.entrySet())
{
stream.writeUTF(model.getKey());
stream.writeUTF(model.getValue());
}
}
catch (IOException e)
{
e.printStackTrace();
}
}
示例4: writeMessage
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@SneakyThrows(IOException.class)
private void writeMessage(AppendBlock block, ByteBuf out) {
int startIdx = out.writerIndex();
ByteBufOutputStream bout = new ByteBufOutputStream(out);
bout.writeInt(block.getType().getCode());
bout.write(LENGTH_PLACEHOLDER);
block.writeFields(bout);
bout.flush();
bout.close();
int endIdx = out.writerIndex();
int fieldsSize = endIdx - startIdx - TYPE_PLUS_LENGTH_SIZE;
out.setInt(startIdx + TYPE_SIZE, fieldsSize + currentBlockSize);
}
示例5: writeData
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
protected void writeData(ByteBufOutputStream buffer) throws IOException {
buffer.writeInt(tileLocationX);
buffer.writeInt(tileLocationY);
buffer.writeInt(tileLocationZ);
buffer.writeInt(text.length);
for (String string : text) {
buffer.writeInt(string.length());
buffer.writeChars(string);
}
}
示例6: writeData
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
protected void writeData(ByteBufOutputStream buffer) throws IOException {
buffer.writeInt(posX);
buffer.writeInt(posY);
buffer.writeInt(posZ);
buffer.writeInt(sound.length());
buffer.writeChars(sound);
}
示例7: encodeInto
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) throws IOException {
ByteBufOutputStream bos = new ByteBufOutputStream(buffer);
bos.writeInt(x);
bos.writeInt(y);
bos.writeInt(z);
NBTHelper.nbtWrite(tag, bos);
}
示例8: write
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void write(ByteBufOutputStream out) throws IOException {
out.writeInt(x);
out.writeInt(y);
out.writeInt(z);
if (payload != null) {
payload.write(out);
}
}
示例9: writeData
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
protected void writeData(ByteBufOutputStream buffer) throws IOException {
buffer.writeInt(tileLocationX);
buffer.writeInt(tileLocationY);
buffer.writeInt(tileLocationZ);
buffer.writeInt(text.length);
for (String string : text) {
buffer.writeInt(string.length());
buffer.writeChars(string);
}
}
示例10: writeData
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
protected void writeData(ByteBufOutputStream buffer) throws IOException {
buffer.writeInt(posX);
buffer.writeInt(posY);
buffer.writeInt(posZ);
buffer.writeInt(sound.length());
buffer.writeChars(sound);
}
示例11: encodeInto
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void encodeInto(ChannelHandlerContext ctx, ByteBuf to) throws IOException {
ByteBufOutputStream bos = new ByteBufOutputStream(to);
bos.writeUTF(script);
bos.writeInt(settings.length);
for (Setting s : settings)
Setting.write(s, bos);
}
示例12: encodeInto
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void encodeInto(ChannelHandlerContext ctx, ByteBuf to) throws IOException {
ByteBufOutputStream bos = new ByteBufOutputStream(to);
bos.writeInt(x);
bos.writeInt(y);
bos.writeInt(z);
writeNBT(tag, bos);
}
示例13: write
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void write(ByteBufOutputStream byteBuf) throws IOException {
byteBuf.writeInt(this.cpuUsage);
byteBuf.writeInt(this.ramUsage);
byteBuf.writeInt(this.ramMax);
}
示例14: write
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void write(ByteBufOutputStream byteBuf) throws IOException {
byteBuf.writeUTF(this.serverType);
byteBuf.writeInt(this.port);
}
示例15: writeData
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
protected void writeData(ByteBufOutputStream buffer) throws IOException {
buffer.writeInt(entityIdToBeNamed);
buffer.writeInt(entityName.length());
buffer.writeChars(entityName);
}