当前位置: 首页>>代码示例>>Java>>正文


Java DataOutput.writeLong方法代码示例

本文整理汇总了Java中java.io.DataOutput.writeLong方法的典型用法代码示例。如果您正苦于以下问题:Java DataOutput.writeLong方法的具体用法?Java DataOutput.writeLong怎么用?Java DataOutput.writeLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.io.DataOutput的用法示例。


在下文中一共展示了DataOutput.writeLong方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toData

import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void toData(DataOutput out) throws IOException {
  super.toData(out);
  out.writeByte(this.op.ordinal());
  // out.writeLong(this.regionVersion);
  out.writeInt(this.regionGCVersions.size());
  boolean persistent = false;
  if (!regionGCVersions.isEmpty()) {
    VersionSource firstEntry = regionGCVersions.keySet().iterator().next();
    if (firstEntry instanceof DiskStoreID) {
      persistent = true;
    }
  }
  out.writeBoolean(persistent);
  for (Map.Entry<VersionSource, Long> entry : this.regionGCVersions.entrySet()) {
    VersionSource member = entry.getKey();
    if (member instanceof DiskStoreID) {
      InternalDataSerializer.invokeToData((DiskStoreID) member, out);
    } else {
      ((InternalDistributedMember) member).writeEssentialData(out);
    }
    out.writeLong(entry.getValue());
  }
  DataSerializer.writeObject(this.eventID, out);
}
 
开发者ID:ampool,项目名称:monarch,代码行数:26,代码来源:DistributedTombstoneOperation.java

示例2: toData

import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void toData(DataOutput out) throws IOException {
  super.toData(out);
  out.writeInt(this.processorId);
  if (this.valueObj != null) {
    DataSerializer.writeObjectAsByteArray(this.valueObj, out);
  } else {
    DataSerializer.writeByteArray(this.value, this.valueLen, out);
  }
  out.writeLong(this.lastModified);
  byte booleans = 0;
  if (this.isSerialized)
    booleans |= SERIALIZED;
  if (this.requestorTimedOut)
    booleans |= REQUESTOR_TIMEOUT;
  if (this.authoritative)
    booleans |= AUTHORATIVE;
  if (this.versionTag != null)
    booleans |= VERSIONED;
  if (this.versionTag instanceof DiskVersionTag)
    booleans |= PERSISTENT;
  out.writeByte(booleans);
  if (this.versionTag != null) {
    InternalDataSerializer.invokeToData(this.versionTag, out);
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:27,代码来源:SearchLoadAndWriteProcessor.java

示例3: writeEssentialData

import java.io.DataOutput; //导入方法依赖的package包/类
public void writeEssentialData(DataOutput out) throws IOException {
  Version.writeOrdinal(out, this.versionOrdinal, true);

  int flags = 0;
  if (networkPartitionDetectionEnabled)
    flags |= NPD_ENABLED_BIT;
  if (preferredForCoordinator)
    flags |= PREFERRED_FOR_COORD_BIT;
  out.writeShort(flags);

  DataSerializer.writeInetAddress(inetAddr, out);
  out.writeInt(udpPort);
  out.writeInt(vmViewId);
  out.writeLong(uuidMSBs);
  out.writeLong(uuidLSBs);

}
 
开发者ID:ampool,项目名称:monarch,代码行数:18,代码来源:GMSMember.java

示例4: write

import java.io.DataOutput; //导入方法依赖的package包/类
public static void write(BigDecimal d, DataOutput out) throws IOException {
  int scale = d.scale();
  BigInteger bigIntPart = d.unscaledValue();
  boolean fastpath = bigIntPart.compareTo(LONG_MAX_AS_BIGINT) < 0
      && bigIntPart .compareTo(LONG_MIN_AS_BIGINT) > 0;

  out.writeInt(scale);
  out.writeBoolean(fastpath);
  if (fastpath) {
    out.writeLong(bigIntPart.longValue());
  } else {
    Text.writeString(out, bigIntPart.toString());
  }
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:15,代码来源:BigDecimalSerializer.java

示例5: writeLongArray

import java.io.DataOutput; //导入方法依赖的package包/类
/**
 * Writes an array of <code>long</code>s to a <code>DataOutput</code>. This method will serialize
 * a <code>null</code> array and not throw a <code>NullPointerException</code>.
 *
 * @throws IOException A problem occurs while writing to <code>out</code>
 *
 * @see #readLongArray
 */
public static void writeLongArray(long[] array, DataOutput out) throws IOException {

  InternalDataSerializer.checkOut(out);

  int length;
  if (array == null) {
    length = -1;
  } else {
    length = array.length;
  }
  InternalDataSerializer.writeArrayLength(length, out);
  if (logger.isTraceEnabled(LogMarker.SERIALIZER)) {
    logger.trace(LogMarker.SERIALIZER, "Writing long array of length {}", length);
  }
  if (length > 0) {
    for (int i = 0; i < length; i++) {
      out.writeLong(array[i]);
    }
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:29,代码来源:DataSerializer.java

示例6: write

import java.io.DataOutput; //导入方法依赖的package包/类
@Override public void write(DataOutput out) throws IOException {
  Bytes.writeByteArray(out, family);
  Bytes.writeByteArray(out, qualifier);
  // start
  if (start == null) {
    Bytes.writeByteArray(out, Bytes.toBytes(true));
  } else {
    Bytes.writeByteArray(out, Bytes.toBytes(false));
    Bytes.writeByteArray(out, start);
    Bytes.writeByteArray(out, Bytes.toBytes(startOp.toString()));
  }
  // stop
  if (stop == null) {
    Bytes.writeByteArray(out, Bytes.toBytes(true));
  } else {
    Bytes.writeByteArray(out, Bytes.toBytes(false));
    Bytes.writeByteArray(out, stop);
    Bytes.writeByteArray(out, Bytes.toBytes(stopOp.toString()));
  }
  out.writeLong(startTs);
  out.writeLong(stopTs);
  Bytes.writeByteArray(out, Bytes.toBytes(dataType.toString()));
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:24,代码来源:ScanRange.java

示例7: write

import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void write(DataOutput out) throws IOException {
  out.writeLong(bytes);
  out.writeInt(nLoc);
  for (int i = 0; i < nLoc; ++i) {
    Text.writeString(out, locations[i]);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:GenerateData.java

示例8: write

import java.io.DataOutput; //导入方法依赖的package包/类
public void write(final DataOutput out) throws IOException {
  Bytes.writeByteArray(out, this.columnFamily);
  Bytes.writeByteArray(out, this.columnQualifier);
  out.writeLong(this.startTs);
  out.writeLong(this.endTs);
  out.writeBoolean(foundColumn);

  out.writeBoolean(filterIfMissing);
  out.writeBoolean(latestVersionOnly);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:TimeRangeFilter.java

示例9: write

import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void write(DataOutput out) throws IOException {
  out.writeLong(version);
  if (methods == null) {
    out.writeBoolean(false);
  } else {
    out.writeBoolean(true);
    out.writeInt(methods.length);
    for (int method : methods) {
      out.writeInt(method);
    }
  }
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:14,代码来源:ProtocolSignature.java

示例10: writeRandom

import java.io.DataOutput; //导入方法依赖的package包/类
public void writeRandom(DataOutput out, final int size) throws IOException {
  long tmp = seed;
  out.writeLong(tmp);
  int i = size - (Long.SIZE / Byte.SIZE);
  while (i > Long.SIZE / Byte.SIZE - 1) {
    tmp = nextRand(tmp);
    out.writeLong(tmp);
    i -= Long.SIZE / Byte.SIZE;
  }
  for (tmp = nextRand(tmp); i > 0; --i) {
    out.writeByte((int)(tmp & 0xFF));
    tmp >>>= Byte.SIZE;
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:GridmixRecord.java

示例11: toData

import java.io.DataOutput; //导入方法依赖的package包/类
/**
 * Writes the contents of this object to the given output.
 */
public void toData(DataOutput out) throws IOException {
  DataSerializer.writeObject(this.name, out);
  DataSerializer.writeObject(this.lesseeThread.getDistributedMember(), out);
  out.writeInt(this.lesseeThread.getThreadId());
  out.writeInt(this.leaseId);
  out.writeLong(this.leaseExpireTime);
}
 
开发者ID:ampool,项目名称:monarch,代码行数:11,代码来源:DLockRemoteToken.java

示例12: writeAdditionalData

import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void writeAdditionalData(DataOutput out) throws IOException {
  out.writeLong(uuidMSBs);
  out.writeLong(uuidLSBs);
  out.write(memberWeight);
}
 
开发者ID:ampool,项目名称:monarch,代码行数:7,代码来源:GMSMember.java

示例13: writeData

import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void writeData(DataOutput output) throws IOException {
	output.writeDouble(lastRate);
	output.writeLong(lastTime);
}
 
开发者ID:akharchuk,项目名称:rate-limiting,代码行数:6,代码来源:EMARateHistory.java

示例14: write

import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void write(DataOutput out) throws IOException {
  Text.writeString(out, url);
  Text.writeString(out, referrer);
  out.writeLong(time);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:DBCountPageView.java

示例15: toData

import java.io.DataOutput; //导入方法依赖的package包/类
@Override
public void toData(DataOutput out) throws IOException {
  super.toData(out);
  out.writeLong(this.lastModified);
}
 
开发者ID:ampool,项目名称:monarch,代码行数:6,代码来源:AbstractUpdateOperation.java


注:本文中的java.io.DataOutput.writeLong方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。