本文整理汇总了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();
}
}
示例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);
}
示例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);
}
示例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();
}
}
示例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());
}
示例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);
}
示例7: write
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void write(ByteBufOutputStream byteBuf) throws IOException {
byteBuf.writeUTF(this.resourceType);
byteBuf.writeUTF(this.resourceName);
}
示例8: write
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void write(ByteBufOutputStream byteBuf) throws IOException {
byteBuf.writeUTF(this.serverType);
byteBuf.writeInt(this.port);
}
示例9: write
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void write(ByteBufOutputStream byteBuf) throws IOException {
byteBuf.writeUTF(apiKey);
}
示例10: write
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void write(ByteBufOutputStream byteBuf) throws IOException {
byteBuf.writeUTF(serverType);
}
示例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());
}
示例12: write
import io.netty.buffer.ByteBufOutputStream; //导入方法依赖的package包/类
@Override
public void write(ByteBufOutputStream out) throws IOException {
out.writeShort(getCallId());
out.writeUTF(getUri());
}