本文整理匯總了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;
}
示例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());
}
}
}
示例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());
}
示例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;
}
示例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();
}