当前位置: 首页>>代码示例>>Java>>正文


Java Input.readInt方法代码示例

本文整理汇总了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;
}
 
开发者ID:CypherCove,项目名称:gdx-cclibs,代码行数:17,代码来源:CatmullRomSplineSerializer.java

示例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;
}
 
开发者ID:CypherCove,项目名称:gdx-cclibs,代码行数:20,代码来源:FloatCounterSerializer.java

示例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;
}
 
开发者ID:yuantiku,项目名称:ytk-mp4j,代码行数:18,代码来源:ArrayMetaData.java

示例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
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:IpPrefixSerializer.java

示例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
}
 
开发者ID:shlee89,项目名称:athena,代码行数:16,代码来源:IpAddressSerializer.java

示例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;
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:15,代码来源:ImmutableCollectionSerializers.java

示例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);
}
 
开发者ID:CypherCove,项目名称:gdx-cclibs,代码行数:8,代码来源:GridPoint3Serializer.java

示例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;
}
 
开发者ID:CypherCove,项目名称:gdx-cclibs,代码行数:12,代码来源:PolylineSerializer.java

示例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;
}
 
开发者ID:CypherCove,项目名称:gdx-cclibs,代码行数:12,代码来源:IntFloatMapSerializer.java

示例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;
}
 
开发者ID:yuantiku,项目名称:ytk-learn,代码行数:14,代码来源:SplitInfo.java

示例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;
}
 
开发者ID:CypherCove,项目名称:gdx-cclibs,代码行数:15,代码来源:AbstractBooleanArraySerializer.java

示例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;
}
 
开发者ID:CypherCove,项目名称:gdx-cclibs,代码行数:28,代码来源:IntMapSerializer.java

示例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;
}
 
开发者ID:CypherCove,项目名称:gdx-cclibs,代码行数:28,代码来源:ObjectIntMapSerializer.java

示例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;
}
 
开发者ID:yuantiku,项目名称:ytk-mp4j,代码行数:15,代码来源:MapMetaData.java

示例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();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:11,代码来源:ImmutableListSerializer.java


注:本文中的com.esotericsoftware.kryo.io.Input.readInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。