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