本文整理匯總了Java中com.esotericsoftware.kryo.io.Output.writeLong方法的典型用法代碼示例。如果您正苦於以下問題:Java Output.writeLong方法的具體用法?Java Output.writeLong怎麽用?Java Output.writeLong使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.esotericsoftware.kryo.io.Output
的用法示例。
在下文中一共展示了Output.writeLong方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write (Kryo kryo, Output output, LongMap map) {
int length = map.size;
output.writeVarInt(length, true);
output.writeBoolean(false); // whether type is written (in case future version of LongMap supports type awareness)
Serializer valueSerializer = null;
if (valueGenericType != null) {
if (valueSerializer == null) valueSerializer = kryo.getSerializer(valueGenericType);
valueGenericType = null;
}
for (Iterator iter = map.iterator(); iter.hasNext();) {
LongMap.Entry entry = (LongMap.Entry)iter.next();
output.writeLong(entry.key);
if (valueSerializer != null) {
kryo.writeObjectOrNull(output, entry.value, valueSerializer);
} else
kryo.writeClassAndObject(output, entry.value);
}
}
示例2: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write(Kryo kryo, Output output, ArrayMetaData<long[]> object) {
try {
long[] arrData = arrayMetaData.getArrData();
arrayMetaData.send(output);
int arrSegNum = arrayMetaData.getSegNum();
for (int i = 0; i < arrSegNum; i++) {
int from = arrayMetaData.getFrom(i);
int to = arrayMetaData.getTo(i);
for (int j = from; j < to; j++) {
output.writeLong(arrData[j]);
}
}
} catch (IOException e) {
LOG.error("double array write exception", e);
System.exit(1);
}
}
示例3: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, LongArray array) {
output.writeVarInt(array.size, true);
output.writeBoolean(array.ordered);
for (int i = 0; i < array.size; i++) {
output.writeLong(array.get(i));
}
}
示例4: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, DefaultPort object) {
kryo.writeClassAndObject(output, object.element());
kryo.writeObject(output, object.number());
output.writeBoolean(object.isEnabled());
kryo.writeObject(output, object.type());
output.writeLong(object.portSpeed());
kryo.writeClassAndObject(output, object.annotations());
}
示例5: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, PortNumber object) {
output.writeBoolean(object.hasName());
output.writeLong(object.toLong());
if (object.hasName()) {
output.writeString(object.name());
}
}
示例6: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, RandomXS128 random) {
output.writeLong(random.getState(0));
output.writeLong(random.getState(1));
}
示例7: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, MastershipBasedTimestamp object) {
output.writeLong(object.termNumber());
output.writeLong(object.sequenceNumber());
}
示例8: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, MastershipTerm object) {
kryo.writeClassAndObject(output, object.master());
output.writeLong(object.termNumber());
}
示例9: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, HostLocation object) {
kryo.writeClassAndObject(output, object.deviceId());
kryo.writeClassAndObject(output, object.port());
output.writeLong(object.time());
}