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


Java DataInput.readUTF方法代码示例

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


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

示例1: fromData

import java.io.DataInput; //导入方法依赖的package包/类
@Override
public void fromData(DataInput in) throws IOException, ClassNotFoundException {
  super.fromData(in);
  this.serviceName = in.readUTF();
  this.objectName = DataSerializer.readObject(in);
  this.startTime = in.readLong();
  this.leaseMillis = in.readLong();
  this.waitMillis = in.readLong();
  this.reentrant = in.readBoolean();
  this.tryLock = in.readBoolean();
  this.processorId = in.readInt();
  this.lockId = in.readInt();
  this.threadId = in.readInt();
  this.grantorVersion = in.readLong();
  this.grantorSerialNumber = in.readInt();
  this.dlsSerialNumber = in.readInt();
}
 
开发者ID:ampool,项目名称:monarch,代码行数:18,代码来源:DLockRequestProcessor.java

示例2: read

import java.io.DataInput; //导入方法依赖的package包/类
public LockInfo read(DataInput dataInput) throws IOException {
    LockInfo out = new LockInfo();
    out.port = dataInput.readInt();
    out.lockId = dataInput.readLong();
    out.pid = dataInput.readUTF();
    out.operation = dataInput.readUTF();
    return out;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:LockInfoSerializer.java

示例3: fromDelta

import java.io.DataInput; //导入方法依赖的package包/类
public void fromDelta(DataInput in) throws IOException, InvalidDeltaException {
  boolean nameC = in.readBoolean();
  if (nameC) {
    this.name = in.readUTF();
  }
  boolean addressC = in.readBoolean();
  if (addressC) {
    this.address = in.readUTF();
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:11,代码来源:ConcurrentMapOpsDUnitTest.java

示例4: fromDelta

import java.io.DataInput; //导入方法依赖的package包/类
public void fromDelta(DataInput in) throws IOException, InvalidDeltaException {
  if (in.readBoolean()) {
    id = in.readInt();
  }
  if (in.readBoolean()) {
    name = in.readUTF();
  }
  fromDeltaCalled = true;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:10,代码来源:TransactionsWithDeltaDUnitTest.java

示例5: func_152455_a

import java.io.DataInput; //导入方法依赖的package包/类
private static NBTBase func_152455_a(DataInput p_152455_0_, int p_152455_1_, NBTSizeTracker p_152455_2_) throws IOException
{
    byte b0 = p_152455_0_.readByte();

    if (b0 == 0)
    {
        return new NBTTagEnd();
    }
    else
    {
        p_152455_0_.readUTF();
        NBTBase nbtbase = NBTBase.createNewByType(b0);

        try
        {
            nbtbase.read(p_152455_0_, p_152455_1_, p_152455_2_);
            return nbtbase;
        }
        catch (IOException ioexception)
        {
            CrashReport crashreport = CrashReport.makeCrashReport(ioexception, "Loading NBT data");
            CrashReportCategory crashreportcategory = crashreport.makeCategory("NBT Tag");
            crashreportcategory.addCrashSection("Tag name", "[UNNAMED TAG]");
            crashreportcategory.addCrashSection("Tag type", Byte.valueOf(b0));
            throw new ReportedException(crashreport);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:29,代码来源:CompressedStreamTools.java

示例6: readUTF

import java.io.DataInput; //导入方法依赖的package包/类
static String readUTF(DataInput in) throws IOException {
    String s = in.readUTF();
    if ("\u0000".equals(s)) {
        return null;
    }
    return s;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:Util.java

示例7: readString

import java.io.DataInput; //导入方法依赖的package包/类
private String readString(final DataInput in) throws IOException {
	switch (version) {
		case VERSION_1:
			return in.readUTF();
		case VERSION_2:
		case VERSION_3:
			int length = in.readInt();
			byte[] bytes = new byte[length];
			in.readFully(bytes);
			return new String(bytes, STRING_CHARSET);
		default:
			throw new RuntimeException("Version not set");
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:15,代码来源:ExampleSetToStream.java

示例8: readString

import java.io.DataInput; //导入方法依赖的package包/类
protected String readString(final DataInput in) throws IOException {
    final String string = in.readUTF();
    if (!ID_SPLITTED.equals(string)) {
        return string;
    }
    final int size = in.readInt();
    final byte[] bytes = new byte[size];
    in.readFully(bytes);
    return new String(bytes, "utf-8");
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:Token.java

示例9: fromData

import java.io.DataInput; //导入方法依赖的package包/类
@Override
public Object fromData(DataInput in) throws IOException, ClassNotFoundException {

  byte classId = in.readByte();
  assertEquals(CLASS_ID, classId);
  NonDataSerializable nds = new NonDataSerializable();
  nds.intValue = in.readInt();
  nds.doubleValue = in.readDouble();
  nds.stringValue = in.readUTF();
  nds.dsValue = (DataSerializable) readObject(in);
  nds.serValue = (Serializable) readObject(in);
  nds.objectValue = readObject(in);

  return nds;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:16,代码来源:DataSerializableJUnitTest.java

示例10: fromData

import java.io.DataInput; //导入方法依赖的package包/类
@Override
public void fromData(DataInput in) throws IOException, ClassNotFoundException {
  super.fromData(in);
  this.processorId = in.readInt();
  this.regionName = in.readUTF();
  this.timeoutMs = in.readInt();
  this.event = (CacheEvent) DataSerializer.readObject(in);
  this.action = in.readInt();
}
 
开发者ID:ampool,项目名称:monarch,代码行数:10,代码来源:SearchLoadAndWriteProcessor.java

示例11: readHostPortFormat

import java.io.DataInput; //导入方法依赖的package包/类
/**
 * Create a new endpoint from input stream data.
 * @param in the input stream
 */
public static TCPEndpoint readHostPortFormat(DataInput in)
    throws IOException
{
    String host = in.readUTF();
    int port = in.readInt();
    return new TCPEndpoint(host, port);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:TCPEndpoint.java

示例12: readExternal

import java.io.DataInput; //导入方法依赖的package包/类
static Chronology readExternal(DataInput in) throws IOException {
    String id = in.readUTF();
    return Chronology.of(id);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:AbstractChronology.java

示例13: readFields

import java.io.DataInput; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
  id = in.readUTF();
  suffix = in.readUTF();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:FileSystemApplicationHistoryStore.java

示例14: readKey

import java.io.DataInput; //导入方法依赖的package包/类
private static String readKey(DataInput input, NBTSizeTracker sizeTracker) throws IOException
{
    return input.readUTF();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:NBTTagCompound.java

示例15: readExternal

import java.io.DataInput; //导入方法依赖的package包/类
static ZoneId readExternal(DataInput in) throws IOException {
    String id = in.readUTF();
    return ZoneId.of(id, false);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:ZoneRegion.java


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