本文整理汇总了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();
}
示例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;
}
示例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();
}
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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");
}
}
示例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");
}
示例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;
}
示例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();
}
示例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);
}
示例12: readExternal
import java.io.DataInput; //导入方法依赖的package包/类
static Chronology readExternal(DataInput in) throws IOException {
String id = in.readUTF();
return Chronology.of(id);
}
示例13: readFields
import java.io.DataInput; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
id = in.readUTF();
suffix = in.readUTF();
}
示例14: readKey
import java.io.DataInput; //导入方法依赖的package包/类
private static String readKey(DataInput input, NBTSizeTracker sizeTracker) throws IOException
{
return input.readUTF();
}
示例15: readExternal
import java.io.DataInput; //导入方法依赖的package包/类
static ZoneId readExternal(DataInput in) throws IOException {
String id = in.readUTF();
return ZoneId.of(id, false);
}