java.io.DataOutput#writeInt ( )源码实例Demo

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

源代码1 项目: android-arscblamer   文件: XmlStartElementChunk.java
@Override
protected void writePayload(DataOutput output, ByteBuffer header, int options)
    throws IOException {
  super.writePayload(output, header, options);
  output.writeInt(namespace);
  output.writeInt(name);
  output.writeShort((short) XmlAttribute.SIZE);  // attribute start
  output.writeShort((short) XmlAttribute.SIZE);
  output.writeShort((short) attributes.size());
  output.writeShort((short) (idIndex + 1));
  output.writeShort((short) (classIndex + 1));
  output.writeShort((short) (styleIndex + 1));
  for (XmlAttribute attribute : attributes) {
    output.write(attribute.toByteArray(options));
  }
}
 
源代码2 项目: RDFS   文件: JobStatus.java
public synchronized void write(DataOutput out) throws IOException {
  jobid.write(out);
  out.writeFloat(setupProgress);
  out.writeFloat(mapProgress);
  out.writeFloat(reduceProgress);
  out.writeFloat(cleanupProgress);
  out.writeInt(runState);
  out.writeLong(startTime);
  Text.writeString(out, user);
  WritableUtils.writeEnum(out, priority);
  Text.writeString(out, schedulingInfo);
}
 
源代码3 项目: gemfirexd-oss   文件: BridgeServerAdvisor.java
@Override
public void toData(DataOutput out) throws IOException {
  super.toData(out);
  DataSerializer.writeStringArray(this.groups, out);
  out.writeInt(maxConnections);
  InternalDataSerializer.invokeToData(initialLoad, out);
  out.writeLong(getLoadPollInterval());
}
 
源代码4 项目: sagetv   文件: TVEditorial.java
void write(DataOutput out, int flags) throws IOException
{
  super.write(out, flags);
  boolean useLookupIdx = (flags & Wizard.WRITE_OPT_USE_ARRAY_INDICES) != 0;
  out.writeInt(showID);
  out.writeInt((title == null) ? 0 : (useLookupIdx ? title.lookupIdx : title.id));
  out.writeInt((network == null) ? 0 : (useLookupIdx ? network.lookupIdx : network.id));
  out.writeUTF(airdate);
  out.writeUTF(description);
  out.writeUTF(imageURL);
}
 
源代码5 项目: gemfirexd-oss   文件: IndexInfo.java
public void toData(DataOutput out) throws IOException
{
	out.writeInt(indexListSize);
	out.writeInt(indexMapSize);
	out.writeInt(minSetSize);
	out.writeInt(maxSetSize);
	DataSerializer.writeObject(minSetQueryKey, out);
	DataSerializer.writeObject(maxSetQueryKey, out);
}
 
源代码6 项目: Concurnas   文件: SerialVersionUIDAdder.java
/**
 * Sorts the items in the collection and writes it to the given output stream.
 *
 * @param itemCollection a collection of items.
 * @param dataOutputStream where the items must be written.
 * @param dotted whether package names must use dots, instead of slashes.
 * @exception IOException if an error occurs.
 */
private static void writeItems(
    final Collection<Item> itemCollection,
    final DataOutput dataOutputStream,
    final boolean dotted)
    throws IOException {
  Item[] items = itemCollection.toArray(new Item[0]);
  Arrays.sort(items);
  for (Item item : items) {
    dataOutputStream.writeUTF(item.name);
    dataOutputStream.writeInt(item.access);
    dataOutputStream.writeUTF(dotted ? item.descriptor.replace('/', '.') : item.descriptor);
  }
}
 
源代码7 项目: netbeans   文件: StandardModuleData.java
private static void writeFiles(DataOutput os, Set<File> files) throws IOException {
    if (files == null) {
        os.writeInt(0);
        return;
    }
    os.writeInt(files.size());
    for (File f : files) {
        Stamps.writeRelativePath(f.getPath(), os);
    }
}
 
源代码8 项目: systemds   文件: ColGroupUncompressed.java
@Override
public void write(DataOutput out) throws IOException {
	// write col contents first (w/ meta data)
	_data.write(out);

	// write col indices
	int len = _data.getNumColumns();
	for(int i = 0; i < len; i++)
		out.writeInt(_colIndexes[i]);
}
 
源代码9 项目: coming   文件: jMutRepair_0019_t.java
/**
 * Millisecond encoding formats:
 *
 * upper two bits  units       field length  approximate range
 * ---------------------------------------------------------------
 * 00              30 minutes  1 byte        +/- 16 hours
 * 01              minutes     4 bytes       +/- 1020 years
 * 10              seconds     5 bytes       +/- 4355 years
 * 11              millis      9 bytes       +/- 292,000,000 years
 *
 * Remaining bits in field form signed offset from 1970-01-01T00:00:00Z.
 */
static void writeMillis(DataOutput out, long millis) throws IOException {
    if (millis % (30 * 60000L) == 0) {
        // Try to write in 30 minute units.
        long units = millis / (30 * 60000L);
        if (((units << (64 - 6)) >> (64 - 6)) == units) {
            // Form 00 (6 bits effective precision)
            out.writeByte((int)(units & 0x3f));
            return;
        }
    }

    if (millis % 60000L == 0) {
        // Try to write minutes.
        long minutes = millis / 60000L;
        if (((minutes << (64 - 30)) >> (64 - 30)) == minutes) {
            // Form 01 (30 bits effective precision)
            out.writeInt(0x40000000 | (int)(minutes & 0x3fffffff));
            return;
        }
    }
    
    if (millis % 1000L == 0) {
        // Try to write seconds.
        long seconds = millis / 1000L;
        if (((seconds << (64 - 38)) >> (64 - 38)) == seconds) {
            // Form 10 (38 bits effective precision)
            out.writeByte(0x80 | (int)((seconds >> 32) & 0x3f));
            out.writeInt((int)(seconds & 0xffffffff));
            return;
        }
    }

    // Write milliseconds either because the additional precision is
    // required or the minutes didn't fit in the field.
    
    // Form 11 (64 bits effective precision, but write as if 70 bits)
    out.writeByte(millis < 0 ? 0xff : 0xc0);
    out.writeLong(millis);
}
 
源代码10 项目: RDFS   文件: LocatedBlocksWithMetaInfo.java
public void write(DataOutput out) throws IOException {
  out.writeInt(this.namespaceid);
  out.writeInt(this.methodFingerPrint);
  super.write(out);
}
 
源代码11 项目: gemfirexd-oss   文件: EvictionAttributesImpl.java
public void toData(DataOutput out) throws IOException {
  out.writeInt(this.maximum);
  DataSerializer.writeObject(this.action, out);
  DataSerializer.writeObject(this.algorithm, out);
}
 
源代码12 项目: parquet-mr   文件: BinaryWritable.java
@Override
public void write(DataOutput output) throws IOException {
  output.writeInt(binary.length());
  binary.writeTo(output);
}
 
源代码13 项目: jdk8u-dev-jdk   文件: ZoneRules.java
/**
 * Writes the state of the transition rule to the stream.
 *
 * @param rule  the transition rule, not null
 * @param out  the output stream, not null
 * @throws IOException if an error occurs
 */
static void writeRule(ZoneOffsetTransitionRule rule, DataOutput out) throws IOException {
    int month = rule.month;
    byte dom = rule.dom;
    int dow = rule.dow;
    LocalTime time = rule.time;
    boolean timeEndOfDay = rule.timeEndOfDay;
    TimeDefinition timeDefinition = rule.timeDefinition;
    ZoneOffset standardOffset = rule.standardOffset;
    ZoneOffset offsetBefore = rule.offsetBefore;
    ZoneOffset offsetAfter = rule.offsetAfter;

    int timeSecs = (timeEndOfDay ? 86400 : time.toSecondOfDay());
    int stdOffset = standardOffset.getTotalSeconds();
    int beforeDiff = offsetBefore.getTotalSeconds() - stdOffset;
    int afterDiff = offsetAfter.getTotalSeconds() - stdOffset;
    int timeByte = (timeSecs % 3600 == 0 ? (timeEndOfDay ? 24 : time.getHour()) : 31);
    int stdOffsetByte = (stdOffset % 900 == 0 ? stdOffset / 900 + 128 : 255);
    int beforeByte = (beforeDiff == 0 || beforeDiff == 1800 || beforeDiff == 3600 ? beforeDiff / 1800 : 3);
    int afterByte = (afterDiff == 0 || afterDiff == 1800 || afterDiff == 3600 ? afterDiff / 1800 : 3);
    int dowByte = (dow == -1 ? 0 : dow);
    int b = (month << 28) +                     // 4 bytes
            ((dom + 32) << 22) +                // 6 bytes
            (dowByte << 19) +                   // 3 bytes
            (timeByte << 14) +                  // 5 bytes
            (timeDefinition.ordinal() << 12) +  // 2 bytes
            (stdOffsetByte << 4) +              // 8 bytes
            (beforeByte << 2) +                 // 2 bytes
            afterByte;                          // 2 bytes
    out.writeInt(b);
    if (timeByte == 31) {
        out.writeInt(timeSecs);
    }
    if (stdOffsetByte == 255) {
        out.writeInt(stdOffset);
    }
    if (beforeByte == 3) {
        out.writeInt(offsetBefore.getTotalSeconds());
    }
    if (afterByte == 3) {
        out.writeInt(offsetAfter.getTotalSeconds());
    }
}
 
源代码14 项目: openjdk-jdk8u-backup   文件: Period.java
void writeExternal(DataOutput out) throws IOException {
    out.writeInt(years);
    out.writeInt(months);
    out.writeInt(days);
}
 
源代码15 项目: openjdk-jdk9   文件: Period.java
void writeExternal(DataOutput out) throws IOException {
    out.writeInt(years);
    out.writeInt(months);
    out.writeInt(days);
}
 
源代码16 项目: ambry   文件: BloomFilterSerializer.java
public void serialize(BloomFilter bf, DataOutput out) throws IOException {
  out.writeInt(bf.hashCount);
  bf.bitset.serialize(out);
}
 
源代码17 项目: tez   文件: TestMRInputSplitDistributor.java
@Override
public void write(DataOutput out) throws IOException {
  out.writeInt(identifier);
}
 
public void toData(DataOutput out) throws IOException {
  out.writeInt(this.field1);
}
 
源代码19 项目: DataVec   文件: IntWritable.java
public void write(DataOutput out) throws IOException {
    out.writeInt(value);
}
 
源代码20 项目: gemfirexd-oss   文件: QuarterPartitionResolver.java
public void toData(DataOutput out) throws IOException {
  DataSerializer.writeProperties(this.resolveProps, out);
  out.writeInt(this.numBuckets);
  
}