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


Java DataOutput.writeUTF方法代码示例

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


在下文中一共展示了DataOutput.writeUTF方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toData

import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void toData(DataOutput out) throws IOException {
  super.toData(out);

  short flags = 0;
  if (this.processorId != 0)
    flags |= HAS_PROCESSOR_ID;
  if (this.ttl != 0)
    flags |= HAS_TTL;
  if (this.idleTime != 0)
    flags |= HAS_IDLE_TIME;
  out.writeShort(flags);

  if (this.processorId != 0) {
    out.writeInt(this.processorId);
  }
  out.writeUTF(this.regionName);
  DataSerializer.writeObject(this.key, out);
  out.writeInt(this.timeoutMs);
  if (this.ttl != 0) {
    InternalDataSerializer.writeSignedVL(this.ttl, out);
  }
  if (this.idleTime != 0) {
    InternalDataSerializer.writeSignedVL(this.idleTime, out);
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:27,代码来源:SearchLoadAndWriteProcessor.java

示例2: serialize

import java.io.DataOutput; //导入方法依赖的package包/类
public void serialize(DataOutput buf, WeaponData data) throws IOException {
	buf.writeByte(this.id);
	switch (type) {
	case BOOLEAN:
		buf.writeBoolean(getBoolean(data));
		break;
	case INTEGER:
		buf.writeInt(getInt(data));
		break;
	case DOUBLE:
		buf.writeFloat(getFloat(data));
		break;
	case STRING:
		buf.writeUTF(getString(data));
		break;
	default:
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:19,代码来源:WeaponData.java

示例3: writeHostPortFormat

import java.io.DataOutput; //导入方法依赖的package包/类
/**
 * Write endpoint to output stream in older format used by
 * UnicastRef for JDK1.1 compatibility.
 */
public void writeHostPortFormat(DataOutput out) throws IOException {
    if (csf != null) {
        throw new InternalError("TCPEndpoint.writeHostPortFormat: " +
            "called for endpoint with non-null socket factory");
    }
    out.writeUTF(host);
    out.writeInt(port);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:TCPEndpoint.java

示例4: writeStrings

import java.io.DataOutput; //导入方法依赖的package包/类
private void writeStrings(DataOutput dos, Collection<String> set) 
throws IOException {
    if (set == null) {
        dos.writeInt(0);
        return;
    }
    dos.writeInt(set.size());
    for (String s : set) {
        dos.writeUTF(s);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:ModuleData.java

示例5: doWritePath

import java.io.DataOutput; //导入方法依赖的package包/类
private static void doWritePath(String codeName, String relPath, Object out) throws IOException {
    if (out instanceof DataOutput) {
        DataOutput dos = (DataOutput) out;
        dos.writeUTF(codeName);
        dos.writeUTF(relPath);
    } else {
        Collection coll = (Collection) out;
        coll.add(codeName);
        coll.add(relPath);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:Stamps.java

示例6: write

import java.io.DataOutput; //导入方法依赖的package包/类
public void write(DataOutput out)
  throws IOException {
  
  boolean hasMessage = (message != null && message.length() > 0);
  out.writeBoolean(hasMessage);
  if (hasMessage) {
    out.writeUTF(message);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:ExternalWritable.java

示例7: writeTag

import java.io.DataOutput; //导入方法依赖的package包/类
private static void writeTag(NBTBase tag, DataOutput output) throws IOException
{
    output.writeByte(tag.getId());

    if (tag.getId() != 0)
    {
        output.writeUTF("");
        tag.write(output);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:11,代码来源:CompressedStreamTools.java

示例8: write

import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void write(DataOutput out) throws IOException {
	out.writeInt(this.id);
	out.writeInt(this.year);
	out.writeInt(this.season);
	out.writeInt(this.month);
	out.writeInt(this.week);
	out.writeInt(this.day);
	out.writeUTF(this.type);
	out.writeLong(this.calendar.getTime());
}
 
开发者ID:liuhaozzu,项目名称:big_data,代码行数:12,代码来源:DateDimension.java

示例9: writeExternal

import java.io.DataOutput; //导入方法依赖的package包/类
void writeExternal(DataOutput out) throws IOException {
    out.writeUTF(getId());
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:4,代码来源:AbstractChronology.java

示例10: write

import java.io.DataOutput; //导入方法依赖的package包/类
/**
 * Write the actual data contents of the tag, implemented in NBT extension classes
 */
void write(DataOutput output) throws IOException
{
    output.writeUTF(this.data);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:NBTTagString.java

示例11: writeJavaVersion

import java.io.DataOutput; //导入方法依赖的package包/类
protected void writeJavaVersion(final DataOutput out) throws IOException {
  out.writeUTF(ObjectUtils.defaultIfNull(getJavaVersion(), ""));
}
 
开发者ID:ampool,项目名称:monarch,代码行数:4,代码来源:LocatorStatusResponse.java

示例12: toDelta

import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void toDelta(DataOutput out) throws IOException {
  out.writeUTF(this.value);
}
 
开发者ID:ampool,项目名称:monarch,代码行数:5,代码来源:MultiVMRegionTestCase.java

示例13: writeExternal

import java.io.DataOutput; //导入方法依赖的package包/类
void writeExternal(DataOutput out) throws IOException {
    out.writeUTF(id);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:4,代码来源:ZoneRegion.java

示例14: writeExternal

import java.io.DataOutput; //导入方法依赖的package包/类
void writeExternal(DataOutput out) throws IOException {
    out.writeUTF(chrono.getId());
    out.writeInt(years);
    out.writeInt(months);
    out.writeInt(days);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:7,代码来源:ChronoPeriodImpl.java

示例15: writeStream

import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void writeStream(final DataOutput data, final T value) throws IOException
{
    data.writeUTF(toJson(value).toString());
}
 
开发者ID:Leviathan-Studio,项目名称:MineIDE,代码行数:6,代码来源:AvancedDataType.java


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