本文整理汇总了Java中com.esotericsoftware.kryo.io.Input.readInt方法的典型用法代码示例。如果您正苦于以下问题:Java Input.readInt方法的具体用法?Java Input.readInt怎么用?Java Input.readInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.esotericsoftware.kryo.io.Input
的用法示例。
在下文中一共展示了Input.readInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public CatmullRomSpline read(Kryo kryo, Input input, Class<CatmullRomSpline> type) {
CatmullRomSpline catmullRomSpline = new CatmullRomSpline();
Class<? extends Vector> vectorType = kryo.readClass(input).getType();
int controlPointsLength = input.readInt();
if (controlPointsLength >= 0){
Vector<?>[] controlPoints = (Vector<?>[])java.lang.reflect.Array.newInstance(vectorType, controlPointsLength);
for (int i = 0; i < controlPointsLength; i++) {
controlPoints[i] = kryo.readObjectOrNull(input, vectorType); // vector type won't be null if control points had a length
}
catmullRomSpline.controlPoints = controlPoints;
}
catmullRomSpline.continuous = input.readBoolean();
catmullRomSpline.spanCount = input.readInt(true);
return catmullRomSpline;
}
示例2: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public FloatCounter read(Kryo kryo, Input input, Class<FloatCounter> type) {
WindowedMean windowedMean = kryo.readObjectOrNull(input, WindowedMean.class);
FloatCounter floatCounter = new FloatCounter(windowedMean == null ? 0 : windowedMean.getWindowSize());
if (windowedMean != null) {
float[] windowedMeanValues = windowedMean.getWindowValues();
for (float f : windowedMeanValues) { // restores the private WindowedMean
floatCounter.put(f);
}
}
floatCounter.count = input.readInt();
floatCounter.total = input.readFloat();
floatCounter.min = input.readFloat();
floatCounter.max = input.readFloat();
floatCounter.average = input.readFloat();
floatCounter.latest = input.readFloat();
floatCounter.value = input.readFloat();
return floatCounter;
}
示例3: recv
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public ArrayMetaData recv(Input input) throws IOException {
ArrayMetaData metaData = new ArrayMetaData();
metaData.srcRank = input.readInt();
metaData.destRank = input.readInt();
metaData.step = input.readInt();
metaData.sum = input.readInt();
int segNum = input.readInt();
for (int i = 0; i < segNum; i++) {
int rank = input.readInt();
int from = input.readInt();
int to = input.readInt();
metaData.insert(rank, from, to);
}
return metaData;
}
示例4: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public IpPrefix read(Kryo kryo, Input input,
Class<IpPrefix> type) {
int octLen = input.readInt();
checkArgument(octLen <= IpAddress.INET6_BYTE_LENGTH);
byte[] octs = new byte[octLen];
input.readBytes(octs);
int prefLen = input.readInt();
// Use the address size to decide whether it is IPv4 or IPv6 address
if (octLen == IpAddress.INET_BYTE_LENGTH) {
return IpPrefix.valueOf(IpAddress.Version.INET, octs, prefLen);
}
if (octLen == IpAddress.INET6_BYTE_LENGTH) {
return IpPrefix.valueOf(IpAddress.Version.INET6, octs, prefLen);
}
return null; // Shouldn't be reached
}
示例5: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public IpAddress read(Kryo kryo, Input input, Class<IpAddress> type) {
final int octLen = input.readInt();
checkArgument(octLen <= IpAddress.INET6_BYTE_LENGTH);
byte[] octs = new byte[octLen];
input.readBytes(octs);
// Use the address size to decide whether it is IPv4 or IPv6 address
if (octLen == IpAddress.INET_BYTE_LENGTH) {
return IpAddress.valueOf(IpAddress.Version.INET, octs);
}
if (octLen == IpAddress.INET6_BYTE_LENGTH) {
return IpAddress.valueOf(IpAddress.Version.INET6, octs);
}
return null; // Shouldn't be reached
}
示例6: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public ImmutableSet<Object> read(final Kryo kryo, final Input input, final Class<ImmutableSet<Object>> type) {
final int size = input.readInt(true);
final ImmutableSet.Builder builder = ImmutableSet.builder();
for (int i = 0; i < size; ++i) {
builder.add(kryo.readClassAndObject(input));
}
final ImmutableSet<Object> result = builder.build();
kryo.reference(result);
return result;
}
示例7: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public GridPoint3 read(Kryo kryo, Input input, Class<GridPoint3> type) {
int x = input.readInt();
int y = input.readInt();
int z = input.readInt();
return new GridPoint3(x, y, z);
}
示例8: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public Polyline read (Kryo kryo, Input input, Class<Polyline> type) {
int length = input.readInt();
float[] vertices = input.readFloats(length);
Polyline polyline = new Polyline(vertices);
polyline.setPosition(input.readFloat(), input.readFloat());
polyline.setOrigin(input.readFloat(), input.readFloat());
polyline.setRotation(input.readFloat());
polyline.setScale(input.readFloat(), input.readFloat());
return polyline;
}
示例9: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
public IntFloatMap read (Kryo kryo, Input input, Class<IntFloatMap> type) {
int length = input.readVarInt(true);
IntFloatMap map = new IntFloatMap(length);
for (int i = 0; i < length; i++) {
int key = input.readInt();
float value = input.readFloat();
map.put(key, value);
}
return map;
}
示例10: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public SplitInfo read(Kryo kryo, Input input, Class<SplitInfo> type) {
SplitInfo splitInfo = new SplitInfo();
splitInfo.lossChg = input.readFloat();
splitInfo.splitIndex = input.readInt();
splitInfo.splitValue = input.readFloat();
int len = input.readInt();
splitInfo.splitSlotInterval = new int[len];
for (int i = 0; i < len; i++) {
splitInfo.splitSlotInterval[i] = input.readInt();
}
return splitInfo;
}
示例11: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public T read(Kryo kryo, Input input, Class<T> type) {
int numBits = input.readInt(true);
int length = (numBits >>> 6) + 1;
long[] array = input.readLongs(length);
T object = createObject(numBits);
for (int i = 0; i < numBits; i++) {
final int word = i >>> 6;
if ((array[word] & (1L << (i & 0x3F))) != 0L){
set(object, i);
}
}
return object;
}
示例12: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
public IntMap read (Kryo kryo, Input input, Class<IntMap> type) {
int length = input.readVarInt(true);
input.readBoolean(); // currently unused
IntMap map = new IntMap(length);
Class valueClass = null;
Serializer valueSerializer = null;
if (valueGenericType != null) {
valueClass = valueGenericType;
if (valueSerializer == null) valueSerializer = kryo.getSerializer(valueClass);
valueGenericType = null;
}
kryo.reference(map);
for (int i = 0; i < length; i++) {
int key = input.readInt();
Object value;
if (valueSerializer != null) {
value = kryo.readObjectOrNull(input, valueClass, valueSerializer);
} else
value = kryo.readClassAndObject(input);
map.put(key, value);
}
return map;
}
示例13: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
public ObjectIntMap read (Kryo kryo, Input input, Class<ObjectIntMap> type) {
int length = input.readVarInt(true);
input.readBoolean(); // currently unused
ObjectIntMap map = create(length);
Class keyClass = null;
Serializer keySerializer = null;
if (keyGenericType != null) {
keyClass = keyGenericType;
if (keySerializer == null) keySerializer = kryo.getSerializer(keyClass);
keyGenericType = null;
}
kryo.reference(map);
for (int i = 0; i < length; i++) {
Object key;
if (keySerializer != null) {
key = kryo.readObject(input, keyClass, keySerializer);
} else
key = kryo.readClassAndObject(input);
int value = input.readInt();
map.put(key, value);
}
return map;
}
示例14: recv
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public MapMetaData recv(Input input) throws IOException {
MapMetaData metaData = new MapMetaData();
metaData.srcRank = input.readInt();
metaData.destRank = input.readInt();
metaData.step = input.readInt();
metaData.sum = input.readInt();
int segNum = input.readInt();
for (int i = 0; i < segNum; i++) {
int rank = input.readInt();
metaData.insert(rank, input.readInt());
}
return metaData;
}
示例15: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public ImmutableList<?> read(Kryo kryo, Input input,
Class<ImmutableList<?>> type) {
final int size = input.readInt();
Builder<Object> builder = ImmutableList.builder();
for (int i = 0; i < size; ++i) {
builder.add(kryo.readClassAndObject(input));
}
return builder.build();
}