类java.io.DataOutput源码实例Demo

下面列出了怎么用java.io.DataOutput的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: big-c   文件: SnapshotFSImageFormat.java
public void writeINodeReferenceWithCount(
    INodeReference.WithCount withCount, DataOutput out,
    boolean writeUnderConstruction) throws IOException {
  final INode referred = withCount.getReferredINode();
  final long id = withCount.getId();
  final boolean firstReferred = !referenceMap.containsKey(id);
  out.writeBoolean(firstReferred);

  if (firstReferred) {
    FSImageSerialization.saveINode2Image(referred, out,
        writeUnderConstruction, this);
    referenceMap.put(id, withCount);
  } else {
    out.writeLong(id);
  }
}
 
源代码2 项目: phoenix   文件: ColumnProjectionFilter.java
@Override
public void write(DataOutput output) throws IOException {
    WritableUtils.writeCompressedByteArray(output, this.emptyCFName);
    WritableUtils.writeVInt(output, this.columnsTracker.size());
    for (Entry<ImmutableBytesPtr, NavigableSet<ImmutableBytesPtr>> entry : this.columnsTracker.entrySet()) {
        // write family name
        WritableUtils.writeCompressedByteArray(output, entry.getKey().copyBytes());
        int qaulsSize = entry.getValue() == null ? 0 : entry.getValue().size();
        WritableUtils.writeVInt(output, qaulsSize);
        if (qaulsSize > 0) {
            for (ImmutableBytesPtr cq : entry.getValue()) {
                // write qualifier name
                WritableUtils.writeCompressedByteArray(output, cq.copyBytes());
            }
        }
    }
    // Write conditionOnlyCfs
    WritableUtils.writeVInt(output, this.conditionOnlyCfs.size());
    for (byte[] f : this.conditionOnlyCfs) {
        WritableUtils.writeCompressedByteArray(output, f);
    }
}
 
源代码3 项目: coming   文件: jMutRepair_0051_s.java
/**
 * Encodes a built DateTimeZone to the given stream. Call readFrom to
 * decode the data into a DateTimeZone object.
 *
 * @param out  the output stream to receive the encoded DateTimeZone
 * @since 1.5 (parameter added)
 */
public void writeTo(String zoneID, DataOutput out) throws IOException {
    // pass false so zone id is not written out
    DateTimeZone zone = toDateTimeZone(zoneID, false);

    if (zone instanceof FixedDateTimeZone) {
        out.writeByte('F'); // 'F' for fixed
        out.writeUTF(zone.getNameKey(0));
        writeMillis(out, zone.getOffset(0));
        writeMillis(out, zone.getStandardOffset(0));
    } else {
        if (zone instanceof CachedDateTimeZone) {
            out.writeByte('C'); // 'C' for cached, precalculated
            zone = ((CachedDateTimeZone)zone).getUncachedZone();
        } else {
            out.writeByte('P'); // 'P' for precalculated, uncached
        }
        ((PrecalculatedZone)zone).writeTo(out);
    }
}
 
源代码4 项目: systemds   文件: ColGroupDDC2.java
@Override
public void write(DataOutput out) throws IOException {
	int numCols = getNumCols();
	int numVals = getNumValues();
	out.writeInt(_numRows);
	out.writeInt(numCols);
	out.writeInt(numVals);

	// write col indices
	for(int i = 0; i < _colIndexes.length; i++)
		out.writeInt(_colIndexes[i]);

	// write distinct values
	for(int i = 0; i < _values.length; i++)
		out.writeDouble(_values[i]);

	// write data
	for(int i = 0; i < _numRows; i++)
		out.writeChar(_data[i]);
}
 
源代码5 项目: gemfirexd-oss   文件: DistributedCacheOperation.java
@Override
public void toData(DataOutput out) throws IOException {
  super.toData(out);
  // extra short added for 7.5
  Version version = InternalDataSerializer
          .getVersionForDataStreamOrNull(out);
  if (version == null || Version.GFE_75.compareTo(version) <= 0) {
    short extBits = computeCompressedExtBits((short) 0);
    out.writeShort(extBits);
  }
  DataSerializer.writeString(this.regionPath, out);
  out.writeByte(this.op.ordinal);
  if (this.callbackArg != null) {
    DataSerializer.writeObject(this.callbackArg, out);
  }
  if (this.hasOldValue) {
    out.writeByte(this.oldValueIsObject);
    final byte policy = valueIsToDeserializationPolicy(this.oldValueIsObject);
    final Object vObj;
    final byte[] vBytes;
    if (this.oldValueIsObject == VALUE_IS_BYTES && this.oldValue instanceof byte[]) {
      vObj = null;
      vBytes = (byte[])this.oldValue;
    } else {
      vObj = this.oldValue;
      vBytes = null;
    }
    writeValue(policy, vObj, vBytes, out);
  }
  if (this.filterRouting != null) {
    InternalDataSerializer.invokeToData(this.filterRouting, out);
  }
  if (this.versionTag != null) {
    InternalDataSerializer.invokeToData(this.versionTag,out);
  }
}
 
源代码6 项目: data-polygamy   文件: FrameworkUtils.java
@Override
public void write(DataOutput out) throws IOException {
    out.writeInt(aggregations.length);
    for (int i = 0; i < aggregations.length; i++) {
        out.writeInt(aggregations[i].getId().ordinal());
        aggregations[i].write(out);
    }
}
 
源代码7 项目: gemfirexd-oss   文件: FxRate.java
public void toData(DataOutput output) throws IOException {
  DataSerializer.writeString(id_ccy_std, output);
  ;
  output.writeInt(id_region);
  DataSerializer.writeString(id_ccy_bse, output);
  output.writeFloat(id_region);
}
 
源代码8 项目: gemfirexd-oss   文件: InternalDataSerializer.java
@Override
public void toData(DataOutput out) throws IOException {
  super.toData(out);
  DataSerializer.writeNonPrimitiveClassName(this.className, out);
  out.writeInt(this.id);
  DataSerializer.writeObject(this.eventId, out);
}
 
源代码9 项目: RDFS   文件: NamespaceInfo.java
public void write(DataOutput out) throws IOException {
  UTF8.writeString(out, getBuildVersion());
  out.writeInt(getLayoutVersion());
  out.writeInt(getNamespaceID());
  out.writeLong(getCTime());
  out.writeInt(getDistributedUpgradeVersion());
}
 
源代码10 项目: big-c   文件: RawLocalFileSystem.java
@Override
public void write(DataOutput out) throws IOException {
  if (!isPermissionLoaded()) {
    loadPermissionInfo();
  }
  super.write(out);
}
 
源代码11 项目: gemfirexd-oss   文件: GfxdJarMessage.java
@Override
public void toData(DataOutput out)
    throws IOException {
  super.toData(out);

  if (GemFireXDUtils.TraceApplicationJars) {
    SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_APP_JARS,
        "GfxdJarMessage#toData: this.sendBytes " + this.sendBytes
            + " and jar bytes " + Arrays.toString(this.jar_bytes));
  }

  out.writeLong(this.id);
  DataSerializer.writeString(this.schemaName, out);
  DataSerializer.writeString(this.sqlName, out);
  DataSerializer.writeByte((byte)this.type, out);

  if (this.type != JAR_REMOVE) {
    if (this.sendBytes) {
      if (GemFireXDUtils.TraceApplicationJars) {
        SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_APP_JARS,
            "GfxdJarMessage#toData: writing byte array "
                + Arrays.toString(this.jar_bytes));
      }
      DataSerializer.writeByteArray(this.jar_bytes, out);
    }
    else {
      if (GemFireXDUtils.TraceApplicationJars) {
        SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_APP_JARS,
            "GfxdJarMessage#toData: sending null jar bytes "
                + Arrays.toString(this.jar_bytes));
      }
      DataSerializer.writeByteArray(null, out);
    }
    DataSerializer.writeLong(this.oldId, out);
  }
}
 
源代码12 项目: gemfirexd-oss   文件: TradesHdfsDataVerifierV2.java
@Override
public void write(DataOutput out) throws IOException {
  System.out.println("writing Trades cid:" + cid + " tid: " + tid + " eid: " + eid + " tradeDate: " + tradeDate.getTime());
  out.writeInt(cid);
  out.writeInt(tid);
  out.writeInt(eid);
  out.writeLong(tradeDate.getTime());
  
}
 
源代码13 项目: vxquery   文件: SubtractOperation.java
@Override
public void operateDTDurationInteger(LongPointable longp1, LongPointable longp2, DataOutput dOut)
        throws SystemException, IOException {
    long value = longp1.longValue();
    value -= longp2.longValue();
    dOut.write(ValueTag.XS_DAY_TIME_DURATION_TAG);
    dOut.writeLong(value);
}
 
源代码14 项目: gemfirexd-oss   文件: RemoteOperationMessage.java
/**
 * Send the contents of this instance to the DataOutput Required to be a
 * {@link com.gemstone.gemfire.DataSerializable}Note: must be symmetric with
 * {@link #fromData(DataInput)}in what it writes
 */
@Override
public void toData(DataOutput out) throws IOException
{
  super.toData(out);
  DataSerializer.writeString(this.regionPath,out);
}
 
源代码15 项目: ignite   文件: BinarySchema.java
/**
 * The object implements the writeTo method to save its contents
 * by calling the methods of DataOutput for its primitive values and strings or
 * calling the writeTo method for other objects.
 *
 * @param out the stream to write the object to.
 * @throws IOException Includes any I/O exceptions that may occur.
 */
public void writeTo(DataOutput out) throws IOException {
    out.writeInt(schemaId);

    out.writeInt(ids.length);

    for (Integer id : ids)
        out.writeInt(id);
}
 
源代码16 项目: wildfly-core   文件: ManagementProtocolHeader.java
/**
 * Write the header information to the provided {@link java.io.DataOutput}.
 *
 * @param output The output to write to
 * @throws IOException If any problems occur writing to the output
 */
public void write(final DataOutput output) throws IOException {
    output.write(ManagementProtocol.SIGNATURE);
    output.writeByte(ManagementProtocol.VERSION_FIELD);
    output.writeInt(getVersion());
    output.writeByte(ManagementProtocol.TYPE);
    output.writeByte(getType());
}
 
源代码17 项目: coming   文件: jKali_0030_s.java
public void writeTo(DataOutput out) throws IOException {
    out.writeByte(iMode);
    out.writeByte(iMonthOfYear);
    out.writeByte(iDayOfMonth);
    out.writeByte(iDayOfWeek);
    out.writeBoolean(iAdvance);
    writeMillis(out, iMillisOfDay);
}
 
源代码18 项目: gemfirexd-oss   文件: BucketServerLocation66.java
@Override
public void toData(DataOutput out) throws IOException {
  super.toData(out);
  DataSerializer.writeInteger(this.bucketId, out);
  DataSerializer.writeBoolean(this.isPrimary, out);
  DataSerializer.writeByte(this.version, out);
  out.writeByte(this.numServerGroups);
  if(this.numServerGroups > 0) {
    for(String s: this.serverGroups) {
      DataSerializer.writeString(s, out);
    }
  }
}
 
源代码19 项目: phoenix   文件: RowKeyValueAccessor.java
@Override
public void write(DataOutput output) throws IOException {
    // Encode hasSeparator and isFixedLength into vint storing offset array length
    // (since there's plenty of room)
    int length = offsets.length << 2;
    length |= (hasSeparator ? 1 << 1 : 0) | (isFixedLength ? 1 : 0);
    ByteUtil.serializeVIntArray(output, offsets, length);
}
 
源代码20 项目: xmrwallet   文件: Bucket.java
public void send(DataOutput out) throws IOException {
    out.writeLong(signature);
    out.writeLong(cb);
    out.writeBoolean(haveToReturnData);
    out.writeInt(command);
    out.writeInt(returnCode);
    out.writeInt(flags);
    out.writeInt(protcolVersion);
    out.write(payload);
}
 
源代码21 项目: gemfirexd-oss   文件: StatAlertNotification.java
public void toData(DataOutput out) throws IOException {
  // Do not modify StatAlert to allow 57 cacheservers to function with 57+ agent
  // However, update of a new StatAlertDefn on 57 server from 57+ agent not covered with this
  DataSerializer.writePrimitiveInt(this.getDefinitionId(), out);
  DataSerializer.writeDate(this.getTime(), out);
  DataSerializer.writeObjectArray(this.getValues(), out);

  DataSerializer.writeString(this.memberId, out);
}
 
源代码22 项目: big-c   文件: GenericWritable.java
@Override
public void write(DataOutput out) throws IOException {
  if (type == NOT_SET || instance == null)
    throw new IOException("The GenericWritable has NOT been set correctly. type="
                          + type + ", instance=" + instance);
  out.writeByte(type);
  instance.write(out);
}
 
源代码23 项目: gemfirexd-oss   文件: SQLChar.java
@Override
public void toData(DataOutput out) throws IOException {
  if (!isNull()) {
    out.writeByte(getTypeId());
    writeData(out, true);
    return;
  }
  this.writeNullDVD(out);
}
 
@Override
public void write(DataOutput out) throws IOException {
  System.out.println("writing Portfolio cid: " + cid + " sid: " + sid + " qty: " + qty + " availQty: " + availQty + " subTotal: " + subTotal.toPlainString()  + " tid: " +  tid);
  out.writeInt(cid);
  out.writeInt(sid);
  out.writeInt(tid);
  out.writeInt(qty);
  out.writeInt(availQty);
  out.writeUTF(subTotal.toPlainString());
  
}
 
源代码25 项目: openjdk-jdk8u-backup   文件: ZoneRules.java
/**
 * Writes the state the ZoneOffset to the stream.
 *
 * @param offset  the offset, not null
 * @param out  the output stream, not null
 * @throws IOException if an error occurs
 */
static void writeOffset(ZoneOffset offset, DataOutput out) throws IOException {
    final int offsetSecs = offset.getTotalSeconds();
    int offsetByte = offsetSecs % 900 == 0 ? offsetSecs / 900 : 127;  // compress to -72 to +72
    out.writeByte(offsetByte);
    if (offsetByte == 127) {
        out.writeInt(offsetSecs);
    }
}
 
源代码26 项目: vxquery   文件: SubtractOperation.java
@Override
public void operateDTDurationDTDuration(LongPointable longp1, LongPointable longp2, DataOutput dOut)
        throws SystemException, IOException {
    long value = longp1.longValue();
    value -= longp2.longValue();
    dOut.write(ValueTag.XS_DAY_TIME_DURATION_TAG);
    dOut.writeLong(value);
}
 
源代码27 项目: data-polygamy   文件: FrameworkUtils.java
@Override
public void write(DataOutput out) throws IOException {
    // spatial
    out.writeInt(this.spatial);
    
    // temporal
    out.writeInt(this.temporal);
    
    // attribute
    out.writeFloat(this.value);
}
 
源代码28 项目: coming   文件: jMutRepair_0051_t.java
public void writeTo(DataOutput out) throws IOException {
    writeMillis(out, iStandardOffset);
    iStartRecurrence.writeTo(out);
    iEndRecurrence.writeTo(out);
}
 
源代码29 项目: gemfirexd-oss   文件: ExpirationAttributes.java
public void toData(DataOutput out) throws IOException {
  out.writeInt(this.timeout);
  DataSerializer.writeObject(this.action, out);
}
 
源代码30 项目: spork   文件: ExampleTuple.java
@Override
public void write(DataOutput out) throws IOException {
    t.write(out);
    out.writeBoolean(synthetic);
    out.writeBoolean(omittable);
}
 
 类所在包
 同包方法