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


Java ByteBufOutputStream.writeUTF方法代码示例

本文整理汇总了Java中io.netty.buffer.ByteBufOutputStream.writeUTF方法的典型用法代码示例。如果您正苦于以下问题:Java ByteBufOutputStream.writeUTF方法的具体用法?Java ByteBufOutputStream.writeUTF怎么用?Java ByteBufOutputStream.writeUTF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.netty.buffer.ByteBufOutputStream的用法示例。


在下文中一共展示了ByteBufOutputStream.writeUTF方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: channelActive

import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void channelActive(ChannelHandlerContext context) throws Exception {
  ByteBuf buffer = context.alloc().ioBuffer(1024);
  boolean success = false;
  try {
    ByteBufOutputStream out = new ByteBufOutputStream(buffer);
    for (String path : myLockedPaths) out.writeUTF(path);
    out.writeUTF(PATHS_EOT_RESPONSE);
    out.close();
    success = true;
  }
  finally {
    if (!success) {
      buffer.release();
    }
  }
  context.writeAndFlush(buffer);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:SocketLock.java

示例3: 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

示例4: 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

示例5: write

import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void write(ByteBufOutputStream out) throws IOException {
    out.writeUTF(getUri());
    out.writeFloat(getWidth());
    out.writeFloat(getHeight());
    out.writeFloat(getTriggerRange());
    out.writeFloat(getFadeRange());
}
 
开发者ID:sk89q,项目名称:playblock,代码行数:9,代码来源:ProjectorUpdate.java

示例6: 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

示例7: write

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

示例8: 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

示例9: write

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

示例10: write

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

示例11: write

import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void write(ByteBufOutputStream out) throws IOException {
    out.writeByte(getCallId());
    out.writeByte(getResponse().ordinal());
    out.writeUTF(getUri());
}
 
开发者ID:sk89q,项目名称:playblock,代码行数:7,代码来源:EnqueueResponse.java

示例12: write

import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void write(ByteBufOutputStream out) throws IOException {
    out.writeShort(getCallId());
    out.writeUTF(getUri());
}
 
开发者ID:sk89q,项目名称:playblock,代码行数:6,代码来源:Enqueue.java


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