本文整理匯總了Java中com.esotericsoftware.kryo.io.Output.writeVarInt方法的典型用法代碼示例。如果您正苦於以下問題:Java Output.writeVarInt方法的具體用法?Java Output.writeVarInt怎麽用?Java Output.writeVarInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.esotericsoftware.kryo.io.Output
的用法示例。
在下文中一共展示了Output.writeVarInt方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write (Kryo kryo, Output output, ObjectFloatMap map) {
int length = map.size;
output.writeVarInt(length, true);
output.writeBoolean(false); // whether type is written (in case future version of ObjectFloatMap supports type awareness)
Serializer keySerializer = null;
if (keyGenericType != null) {
if (keySerializer == null) keySerializer = kryo.getSerializer(keyGenericType);
keyGenericType = null;
}
for (Iterator iter = map.iterator(); iter.hasNext();) {
ObjectFloatMap.Entry entry = (ObjectFloatMap.Entry)iter.next();
if (keySerializer != null) {
kryo.writeObject(output, entry.key, keySerializer);
} else
kryo.writeClassAndObject(output, entry.key);
output.writeFloat(entry.value);
}
}
示例2: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, SortedIntList list) {
output.writeVarInt(list.size(), true);
Serializer serializer = null;
if (genericType != null) {
if (serializer == null) serializer = kryo.getSerializer(genericType);
genericType = null;
}
for (Iterator<SortedIntList.Node> iter = list.iterator(); iter.hasNext();){
SortedIntList.Node node = iter.next();
output.writeInt(node.index);
if (serializer != null) {
kryo.writeObjectOrNull(output, node.value, serializer);
} else {
kryo.writeClassAndObject(output, node.value);
}
}
}
示例3: 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);
}
}
示例4: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write (Kryo kryo, Output output, IntMap map) {
int length = map.size;
output.writeVarInt(length, true);
output.writeBoolean(false); // whether type is written (in case future version of IntMap 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();) {
IntMap.Entry entry = (IntMap.Entry)iter.next();
output.writeInt(entry.key);
if (valueSerializer != null) {
kryo.writeObjectOrNull(output, entry.value, valueSerializer);
} else
kryo.writeClassAndObject(output, entry.value);
}
}
示例5: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write (Kryo kryo, Output output, ObjectIntMap map) {
int length = map.size;
output.writeVarInt(length, true);
output.writeBoolean(false); // whether type is written (in case future version of ObjectIntMap supports type awareness)
Serializer keySerializer = null;
if (keyGenericType != null) {
if (keySerializer == null) keySerializer = kryo.getSerializer(keyGenericType);
keyGenericType = null;
}
for (Iterator iter = map.iterator(); iter.hasNext();) {
ObjectIntMap.Entry entry = (ObjectIntMap.Entry)iter.next();
if (keySerializer != null) {
kryo.writeObject(output, entry.key, keySerializer);
} else
kryo.writeClassAndObject(output, entry.key);
output.writeInt(entry.value);
}
}
示例6: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, WindowedMean windowedMean) {
int size = windowedMean.getWindowSize();
float[] values = windowedMean.getWindowValues();
int count = values.length;
output.writeVarInt(size, true);
output.writeVarInt(count, true);
output.writeFloats(values);
}
示例7: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, IntSet set) {
output.writeVarInt(set.size, true);
IntSet.IntSetIterator iter = set.iterator();
while (iter.hasNext) {
output.writeInt(iter.next());
}
}
示例8: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, CharArray array) {
output.writeVarInt(array.size, true);
output.writeBoolean(array.ordered);
for (int i = 0; i < array.size; i++) {
output.writeChar(array.get(i));
}
}
示例9: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write (Kryo kryo, Output output, T map) {
int length = map.size;
output.writeVarInt(length, true);
output.writeBoolean(false); // whether type is written (in case future version of ObjectMap supports type awareness)
Serializer keySerializer = null;
if (keyGenericType != null) {
if (keySerializer == null) keySerializer = kryo.getSerializer(keyGenericType);
keyGenericType = null;
}
Serializer valueSerializer = null;
if (valueGenericType != null) {
if (valueSerializer == null) valueSerializer = kryo.getSerializer(valueGenericType);
valueGenericType = null;
}
for (Iterator iter = map.iterator(); iter.hasNext();) {
ObjectMap.Entry entry = (ObjectMap.Entry)iter.next();
if (keySerializer != null) {
kryo.writeObject(output, entry.key, keySerializer);
} else
kryo.writeClassAndObject(output, entry.key);
if (valueSerializer != null) {
kryo.writeObjectOrNull(output, entry.value, valueSerializer);
} else
kryo.writeClassAndObject(output, entry.value);
}
}
示例10: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write (Kryo kryo, Output output, IntFloatMap map) {
int length = map.size;
output.writeVarInt(length, true);
for (Iterator iter = map.iterator(); iter.hasNext();) {
IntFloatMap.Entry entry = (IntFloatMap.Entry)iter.next();
output.writeInt(entry.key);
output.writeFloat(entry.value);
}
}
示例11: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, FloatArray array) {
output.writeVarInt(array.size, true);
output.writeBoolean(array.ordered);
for (int i = 0; i < array.size; i++) {
output.writeFloat(array.get(i));
}
}
示例12: 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));
}
}
示例13: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write (Kryo kryo, Output output, IntIntMap map) {
int length = map.size;
output.writeVarInt(length, true);
for (Iterator iter = map.iterator(); iter.hasNext();) {
IntIntMap.Entry entry = (IntIntMap.Entry)iter.next();
output.writeInt(entry.key);
output.writeInt(entry.value);
}
}
示例14: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write (Kryo kryo, Output output, ArrayMap map) {
output.writeBoolean(map.ordered);
int length = map.size;
output.writeVarInt(length, true);
kryo.writeClass(output, map.keys.getClass().getComponentType());
kryo.writeClass(output, map.values.getClass().getComponentType());
Serializer keySerializer = null;
if (keyGenericType != null) {
if (keySerializer == null) keySerializer = kryo.getSerializer(keyGenericType);
keyGenericType = null;
}
Serializer valueSerializer = null;
if (valueGenericType != null) {
if (valueSerializer == null) valueSerializer = kryo.getSerializer(valueGenericType);
valueGenericType = null;
}
for (Iterator iter = map.iterator(); iter.hasNext();) {
ObjectMap.Entry entry = (ObjectMap.Entry)iter.next();
if (keySerializer != null) {
kryo.writeObject(output, entry.key, keySerializer);
} else
kryo.writeClassAndObject(output, entry.key);
if (valueSerializer != null) {
kryo.writeObjectOrNull(output, entry.value, valueSerializer);
} else
kryo.writeClassAndObject(output, entry.value);
}
}
示例15: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write (Kryo kryo, Output output, IdentityMap map) {
int length = map.size;
output.writeVarInt(length, true);
output.writeBoolean(false); // whether type is written (in case future version of IdentityMap supports type awareness)
Serializer keySerializer = null;
if (keyGenericType != null) {
if (keySerializer == null) keySerializer = kryo.getSerializer(keyGenericType);
keyGenericType = null;
}
Serializer valueSerializer = null;
if (valueGenericType != null) {
if (valueSerializer == null) valueSerializer = kryo.getSerializer(valueGenericType);
valueGenericType = null;
}
for (Iterator iter = map.iterator(); iter.hasNext();) {
IdentityMap.Entry entry = (IdentityMap.Entry)iter.next();
if (keySerializer != null) {
kryo.writeObject(output, entry.key, keySerializer);
} else
kryo.writeClassAndObject(output, entry.key);
if (valueSerializer != null) {
kryo.writeObjectOrNull(output, entry.value, valueSerializer);
} else
kryo.writeClassAndObject(output, entry.value);
}
}