當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。