java.io.DataInput#readInt ( )源码实例Demo

下面列出了java.io.DataInput#readInt ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: incubator-tez   文件: TezHeartbeatRequest.java
@Override
public void readFields(DataInput in) throws IOException {
  if (in.readBoolean()) {
    int eventsCount = in.readInt();
    events = new ArrayList<TezEvent>(eventsCount);
    for (int i = 0; i < eventsCount; ++i) {
      TezEvent e = new TezEvent();
      e.readFields(in);
      events.add(e);
    }
  }
  if (in.readBoolean()) {
    currentTaskAttemptID = TezTaskAttemptID.readTezTaskAttemptID(in);
  } else {
    currentTaskAttemptID = null;
  }
  startIndex = in.readInt();
  maxEvents = in.readInt();
  requestId = in.readLong();
  containerIdentifier = Text.readString(in);
}
 
源代码2 项目: Arabesque   文件: ODAGStash.java
@Override
public void readFields(DataInput dataInput) throws IOException {
    if (true) {
        throw new RuntimeException("Shouldn't be used any more");
    }
    compressedEmbeddingsByPattern.clear();
    int numEntries = dataInput.readInt();
    for (int i = 0; i < numEntries; ++i) {
        Pattern pattern = Configuration.get().createPattern();
        pattern.readFields(dataInput);
        ODAG shrunkEmbeddings = new ODAG(false);
        shrunkEmbeddings.setPattern(pattern);
        shrunkEmbeddings.readFields(dataInput);
        compressedEmbeddingsByPattern.put(pattern, shrunkEmbeddings);
    }
}
 
源代码3 项目: RDFS   文件: CombineFileSplit.java
public void readFields(DataInput in) throws IOException {
  totLength = in.readLong();
  int arrLength = in.readInt();
  lengths = new long[arrLength];
  for(int i=0; i<arrLength;i++) {
    lengths[i] = in.readLong();
  }
  int filesLength = in.readInt();
  paths = new Path[filesLength];
  for(int i=0; i<filesLength;i++) {
    paths[i] = new Path(Text.readString(in));
  }
  arrLength = in.readInt();
  startoffset = new long[arrLength];
  for(int i=0; i<arrLength;i++) {
    startoffset[i] = in.readLong();
  }
}
 
源代码4 项目: gemfirexd-oss   文件: QueryTask.java
@Override
 public void fromData(DataInput input) throws IOException, ClassNotFoundException
{
	super.fromData(input);
	uuid = DataSerializer.readString(input);
	queryString = DataSerializer.readString(input);
	nextEnabled = input.readBoolean();
	isPRLocalData = input.readBoolean();
	fetchSize = input.readInt();
	keysOnly = input.readBoolean();
}
 
源代码5 项目: hadoop-gpu   文件: Counters.java
/**
 * Read a set of groups.
 */
public synchronized void readFields(DataInput in) throws IOException {
  int numClasses = in.readInt();
  counters.clear();
  while (numClasses-- > 0) {
    String groupName = Text.readString(in);
    Group group = new Group(groupName);
    group.readFields(in);
    counters.put(groupName, group);
  }
}
 
源代码6 项目: gemfirexd-oss   文件: ObjectPartList.java
public void fromData(DataInput in) throws IOException, ClassNotFoundException {
  this.hasKeys = in.readBoolean();
  if (this.hasKeys) {
    this.keys = new ArrayList();
  }
  int numObjects = in.readInt();
  if (numObjects > 0) {
    for (int index = 0; index < numObjects; ++index) {
      if (this.hasKeys) {
        Object key = DataSerializer.readObject(in);
        this.keys.add(key);
      }
      boolean isException = in.readBoolean();
      Object value;
      if (isException) {
        byte[] exBytes = DataSerializer.readByteArray(in);
        value = CacheServerHelper.deserialize(exBytes);
        // ignore the exception string meant for native clients
        DataSerializer.readString(in);
      }
      else {
        value = DataSerializer.readObject(in);
      }
      this.objects.add(value);
    }
  }
}
 
源代码7 项目: spork   文件: L10.java
public void readFields(DataInput in) throws IOException {
    timespent = in.readInt();
    estimated_revenue = in.readDouble();
    int len = in.readInt();
    byte[] b = new byte[len];
    in.readFully(b);
    query_term = new String(b);
}
 
@Override
public void fromData(DataInput in) throws IOException, ClassNotFoundException
{
  super.fromData(in);
  this.prId = in.readInt();
  this.bucketId = in.readInt();
  this.processorId = in.readInt();
  this.profile = (BucketAdvisor.BucketProfile)DataSerializer.readObject(in);
}
 
源代码9 项目: jpmml-xgboost   文件: XGBoostDataInput.java
public int[] readIntArray(int length) throws IOException {
	DataInput dataInput = asDataInput();

	int[] result = new int[length];

	for(int i = 0; i < result.length; i++){
		result[i] = dataInput.readInt();
	}

	return result;
}
 
源代码10 项目: consulo   文件: PutSystemLabelChange.java
public PutSystemLabelChange(DataInput in) throws IOException {
  super(in);
  myColor = in.readInt();
}
 
源代码11 项目: gemfirexd-oss   文件: WaitForViewInstallation.java
@Override
public void fromData(DataInput in) throws ClassNotFoundException, IOException {
  super.fromData(in);
  this.viewId = in.readLong();
  this.processorId = in.readInt();
}
 
源代码12 项目: dragonwell8_jdk   文件: ZoneInfoFile.java
public static int readOffset(DataInput in) throws IOException {
    int offsetByte = in.readByte();
    return offsetByte == 127 ? in.readInt() : offsetByte * 900;
}
 
源代码13 项目: kylin   文件: AppendDictSliceKey.java
public void readFields(DataInput in) throws IOException {
    key = new byte[in.readInt()];
    in.readFully(key);
}
 
源代码14 项目: KeePassJava2   文件: KdbSerializer.java
/**
 * Deserialize a KdbEntry from a data source
 *
 * @param database  a database to insert the entry into
 * @param dataInput a source of data
 * @throws IOException
 */
private static void deserializeEntry(KdbDatabase database, DataInput dataInput) throws IOException {
    int fieldType;
    KdbEntry entry = new KdbEntry();
    while ((fieldType = dataInput.readUnsignedShort()) != 0xFFFF) {
        switch (fieldType) {
            case 0x0000:
                // we are not doing anything with ExtData for now. Contains header hash ...
                readExtData(dataInput);
                break;
            case 0x0001:
                entry.setUuid(readUuid(dataInput));
                break;
            case 0x0002:
                int groupId = readInt(dataInput);
                // group UUIDs are just the index of the group converted to a UUID
                Group group = database.findGroup(new UUID(0, groupId));
                if (group == null) {
                    throw new IllegalStateException("Entry belongs to group that does not exist");
                }
                group.addEntry(entry);
                break;
            case 0x0003:
                entry.setIcon(new KdbIcon(readInt(dataInput)));
                break;
            case 0x0004:
                entry.setTitle(readString(dataInput));
                break;
            case 0x0005:
                entry.setUrl(readString(dataInput));
                break;
            case 0x0006:
                entry.setUsername(readString(dataInput));
                break;
            case 0x0007:
                entry.setPassword(readString(dataInput));
                break;
            case 0x0008:
                // these are not really notes, they are things like properties from KDBX databases
                // that don't have anywhere else to live and that we would like to expose
                entry.setNotes(readString(dataInput));
                break;
            case 0x0009:
                entry.setCreationTime(readDate(dataInput));
                break;
            case 0x000A:
                entry.setLastModificationTime(readDate(dataInput));
                break;
            case 0x000B:
                entry.setLastAccessTime(readDate(dataInput));
                break;
            case 0x000C:
                entry.setExpiryTime(readDate(dataInput));
                break;
            case 0x000D:
                entry.setBinaryDescription(readString(dataInput));
                break;
            case 0x000E:
                entry.setBinaryData(readBuffer(dataInput));
                break;
            default:
                throw new IllegalStateException("Unknown field type");
        }
    }
    // consume the length indicator on the final block
    dataInput.readInt();
}
 
public void fromData(DataInput in) throws IOException, ClassNotFoundException
{
  this.arr = DataSerializer.readByteArray(in);
  this.name = DataSerializer.readString(in);
  this.identifier = in.readInt();
}
 
源代码16 项目: kylin-on-parquet-v2   文件: MergeDictionaryJob.java
@Override
public void readFields(DataInput dataInput) throws IOException {
    this.index = dataInput.readInt();
}
 
源代码17 项目: gemfirexd-oss   文件: ManagerStartupMessage.java
@Override
public void fromData(DataInput in) throws IOException,
    ClassNotFoundException {
  super.fromData(in);
  this.alertLevel = in.readInt();
}
 
源代码18 项目: KeePassJava2   文件: KdbSerializer.java
private static int readInt(DataInput dataInput) throws IOException {
    if (dataInput.readInt() != 4) {
        throw new IllegalStateException("Integer must be 4 bytes");
    }
    return dataInput.readInt();
}
 
源代码19 项目: gemfirexd-oss   文件: TinyObject.java
public void fromData(DataInput in) throws IOException, ClassNotFoundException {
  this.id = in.readInt();
  this.intField = in.readInt();
}
 
源代码20 项目: Tomcat8-Source-Read   文件: ConstantInteger.java
/**
 * Initialize instance from file data.
 *
 * @param file Input stream
 * @throws IOException
 */
ConstantInteger(final DataInput file) throws IOException {
    super(Const.CONSTANT_Integer);
    this.bytes = file.readInt();
}