当前位置: 首页>>代码示例>>Java>>正文


Java ByteBufOutputStream.writeInt方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:mchorse,项目名称:blockbuster,代码行数:21,代码来源:PacketFrames.java

示例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);
}
 
开发者ID:MinecraftCloudSystem,项目名称:MCS-Master,代码行数:8,代码来源:PacketAuthResponse.java

示例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();
    }
}
 
开发者ID:mchorse,项目名称:blockbuster,代码行数:40,代码来源:PacketModels.java

示例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);
}
 
开发者ID:pravega,项目名称:pravega,代码行数:14,代码来源:CommandEncoder.java

示例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);
    }
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10-pre-1.3a,代码行数:12,代码来源:PacketTileText.java

示例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);
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10-pre-1.3a,代码行数:9,代码来源:PacketStreamSound.java

示例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);
}
 
开发者ID:DavidGoldman,项目名称:NBTEdit,代码行数:9,代码来源:TileNBTPacket.java

示例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);
    }
}
 
开发者ID:sk89q,项目名称:playblock,代码行数:10,代码来源:TileEntityPayload.java

示例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);
    }
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10,代码行数:11,代码来源:PZPacketTileText.java

示例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);
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10,代码行数:8,代码来源:PZPacketPlaySound.java

示例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);
}
 
开发者ID:DavidGoldman,项目名称:MinecraftScripting,代码行数:9,代码来源:SettingsPacket.java

示例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);
}
 
开发者ID:DavidGoldman,项目名称:MinecraftScripting,代码行数:9,代码来源:TileNBTPacket.java

示例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);
}
 
开发者ID:MinecraftCloudSystem,项目名称:MCS-Master,代码行数:7,代码来源:PacketServerStatus.java

示例14: write

import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void write(ByteBufOutputStream byteBuf) throws IOException {
	byteBuf.writeUTF(this.serverType);
	byteBuf.writeInt(this.port);
}
 
开发者ID:MinecraftCloudSystem,项目名称:MCS-Master,代码行数:6,代码来源:PacketServerStarted.java

示例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);
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10-pre-1.3a,代码行数:7,代码来源:PacketNameSync.java


注:本文中的io.netty.buffer.ByteBufOutputStream.writeInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。