當前位置: 首頁>>代碼示例>>Java>>正文


Java ByteArrayDataOutput.writeLong方法代碼示例

本文整理匯總了Java中com.google.common.io.ByteArrayDataOutput.writeLong方法的典型用法代碼示例。如果您正苦於以下問題:Java ByteArrayDataOutput.writeLong方法的具體用法?Java ByteArrayDataOutput.writeLong怎麽用?Java ByteArrayDataOutput.writeLong使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.common.io.ByteArrayDataOutput的用法示例。


在下文中一共展示了ByteArrayDataOutput.writeLong方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setClusterIds

import com.google.common.io.ByteArrayDataOutput; //導入方法依賴的package包/類
/**
 * Marks that the clusters with the given clusterIds have consumed the mutation
 * @param clusterIds of the clusters that have consumed the mutation
 */
public Mutation setClusterIds(List<UUID> clusterIds) {
  ByteArrayDataOutput out = ByteStreams.newDataOutput();
  out.writeInt(clusterIds.size());
  for (UUID clusterId : clusterIds) {
    out.writeLong(clusterId.getMostSignificantBits());
    out.writeLong(clusterId.getLeastSignificantBits());
  }
  setAttribute(CONSUMED_CLUSTER_IDS, out.toByteArray());
  return this;
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:15,代碼來源:Mutation.java

示例2: writeConstantPool

import com.google.common.io.ByteArrayDataOutput; //導入方法依賴的package包/類
static void writeConstantPool(ConstantPool constantPool, ByteArrayDataOutput output) {
  output.writeShort(constantPool.nextEntry);
  for (ConstantPool.Entry e : constantPool.constants()) {
    output.writeByte(e.kind().tag());
    Value value = e.value();
    switch (e.kind()) {
      case CLASS_INFO:
      case STRING:
        output.writeShort(((IntValue) value).value());
        break;
      case INTEGER:
        output.writeInt(((IntValue) value).value());
        break;
      case DOUBLE:
        output.writeDouble(((DoubleValue) value).value());
        break;
      case FLOAT:
        output.writeFloat(((FloatValue) value).value());
        break;
      case LONG:
        output.writeLong(((LongValue) value).value());
        break;
      case UTF8:
        output.writeUTF(((StringValue) value).value());
        break;
      default:
        throw new AssertionError(e.kind());
    }
  }
}
 
開發者ID:google,項目名稱:turbine,代碼行數:31,代碼來源:ClassWriter.java

示例3: setClusterIds

import com.google.common.io.ByteArrayDataOutput; //導入方法依賴的package包/類
/**
 * Marks that the clusters with the given clusterIds have consumed the mutation
 * @param clusterIds of the clusters that have consumed the mutation
 */
public void setClusterIds(List<UUID> clusterIds) {
  ByteArrayDataOutput out = ByteStreams.newDataOutput();
  out.writeInt(clusterIds.size());
  for (UUID clusterId : clusterIds) {
    out.writeLong(clusterId.getMostSignificantBits());
    out.writeLong(clusterId.getLeastSignificantBits());
  }
  setAttribute(CONSUMED_CLUSTER_IDS, out.toByteArray());
}
 
開發者ID:fengchen8086,項目名稱:LCIndex-HBase-0.94.16,代碼行數:14,代碼來源:Mutation.java

示例4: setClusterIds

import com.google.common.io.ByteArrayDataOutput; //導入方法依賴的package包/類
/**
 * Marks that the clusters with the given clusterIds have consumed the mutation
 *
 * @param clusterIds of the clusters that have consumed the mutation
 */
public Mutation setClusterIds(List<UUID> clusterIds) {
    ByteArrayDataOutput out = ByteStreams.newDataOutput();
    out.writeInt(clusterIds.size());
    for (UUID clusterId : clusterIds) {
        out.writeLong(clusterId.getMostSignificantBits());
        out.writeLong(clusterId.getLeastSignificantBits());
    }
    setAttribute(CONSUMED_CLUSTER_IDS, out.toByteArray());
    return this;
}
 
開發者ID:grokcoder,項目名稱:pbase,代碼行數:16,代碼來源:Mutation.java

示例5: typeToBytes

import com.google.common.io.ByteArrayDataOutput; //導入方法依賴的package包/類
@Override
protected byte[] typeToBytes(Long p) {
	ByteArrayDataOutput out = ByteStreams.newDataOutput();
	out.writeLong(p.longValue());
	return out.toByteArray();
}
 
開發者ID:agwlvssainokuni,項目名稱:sqlapp,代碼行數:7,代碼來源:SecureLongEncoder.java


注:本文中的com.google.common.io.ByteArrayDataOutput.writeLong方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。