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


Java Input类代码示例

本文整理汇总了Java中com.esotericsoftware.kryo.io.Input的典型用法代码示例。如果您正苦于以下问题:Java Input类的具体用法?Java Input怎么用?Java Input使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Input类属于com.esotericsoftware.kryo.io包,在下文中一共展示了Input类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: read

import com.esotericsoftware.kryo.io.Input; //导入依赖的package包/类
@Override
public MapMetaData<Integer> read(Kryo kryo, Input input, Class<MapMetaData<Integer>> type) {
    try {
        thatMapMetaData = mapMetaData.recv(input);
        int thatMapSegNum = thatMapMetaData.getSegNum();
        List<Map<String, Integer>> mapDataList = new ArrayList<>(thatMapSegNum);
        thatMapMetaData.setMapDataList(mapDataList);

        for (int i = 0; i < thatMapSegNum; i++) {
            int dataNum = thatMapMetaData.getDataNum(i);
            Map<String, Integer> mapData = new HashMap<>(dataNum);
            mapDataList.add(mapData);
            for (int j = 0; j < dataNum; j++) {
                String key = input.readString();
                Integer val = input.readInt();
                mapData.put(key, val);
            }
        }
    } catch (IOException e) {
        LOG.error("double array read exception", e);
        System.exit(1);
    }
    return thatMapMetaData;
}
 
开发者ID:yuantiku,项目名称:ytk-mp4j,代码行数:25,代码来源:IntOperand.java

示例2: read

import com.esotericsoftware.kryo.io.Input; //导入依赖的package包/类
public ArrayMetaData<long[]> read(Kryo kryo, Input input, Class<ArrayMetaData<long[]>> type) {
    try {
        long[] arrData = arrayMetaData.getArrData();
        thatArrMetaData = arrayMetaData.recv(input);
        int arrSegNum = thatArrMetaData.getSegNum();
        for (int i = 0; i < arrSegNum; i++) {
            int from = thatArrMetaData.getFrom(i);
            int to = thatArrMetaData.getTo(i);
            for (int j = from; j < to; j++) {
                arrData[j] = operator.apply(arrData[j], input.readLong());
            }
        }
        thatArrMetaData.setArrData(arrData);
    } catch (IOException e) {
        LOG.error("double array read exception", e);
        System.exit(1);
    }
    return thatArrMetaData;
}
 
开发者ID:yuantiku,项目名称:ytk-mp4j,代码行数:20,代码来源:LongOperand.java

示例3: read

import com.esotericsoftware.kryo.io.Input; //导入依赖的package包/类
public ArrayMetaData<short[]> read(Kryo kryo, Input input, Class<ArrayMetaData<short[]>> type) {
    try {
        short[] arrData = arrayMetaData.getArrData();
        thatArrMetaData = arrayMetaData.recv(input);
        int arrSegNum = thatArrMetaData.getSegNum();
        for (int i = 0; i < arrSegNum; i++) {
            int from = thatArrMetaData.getFrom(i);
            int to = thatArrMetaData.getTo(i);
            for (int j = from; j < to; j++) {
                arrData[j] = operator.apply(arrData[j], input.readShort());
            }
        }
        thatArrMetaData.setArrData(arrData);
    } catch (IOException e) {
        LOG.error("double array read exception", e);
        System.exit(1);
    }
    return thatArrMetaData;
}
 
开发者ID:yuantiku,项目名称:ytk-mp4j,代码行数:20,代码来源:ShortOperand.java

示例4: createService

import com.esotericsoftware.kryo.io.Input; //导入依赖的package包/类
@Override
protected GoogleAccountsService createService(final Kryo kryo, final Input input, final String id,
        final String originalUrl, final String artifactId) {

    final String requestId = kryo.readObject(input, String.class);
    final String relayState = kryo.readObject(input, String.class);
    try {
        return (GoogleAccountsService) CONSTRUCTOR.newInstance(
                id,
                originalUrl,
                artifactId,
                relayState,
                requestId,
                privateKey,
                publicKey,
                alternateUsername);
    } catch (final Exception e) {
        throw new IllegalStateException("Error creating SamlService", e);
    }
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:21,代码来源:GoogleAccountsServiceSerializer.java

示例5: read

import com.esotericsoftware.kryo.io.Input; //导入依赖的package包/类
@Override
public Instructions.ExtensionInstructionWrapper read(Kryo kryo, Input input,
                                                     Class<Instructions.ExtensionInstructionWrapper> type) {
    ExtensionTreatmentType exType = (ExtensionTreatmentType) kryo.readClassAndObject(input);
    DeviceId deviceId = (DeviceId) kryo.readClassAndObject(input);

    DriverService driverService = DefaultServiceDirectory.getService(DriverService.class);
    DriverHandler handler = new DefaultDriverHandler(
            new DefaultDriverData(driverService.getDriver(deviceId), deviceId));

    ExtensionTreatmentResolver resolver = handler.behaviour(ExtensionTreatmentResolver.class);
    ExtensionTreatment instruction = resolver.getExtensionInstruction(exType);

    byte[] bytes = (byte[]) kryo.readClassAndObject(input);

    instruction.deserialize(bytes);

    return Instructions.extension(instruction, deviceId);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:20,代码来源:ExtensionInstructionSerializer.java

示例6: createService

import com.esotericsoftware.kryo.io.Input; //导入依赖的package包/类
@Override
protected GoogleAccountsService createService(final Kryo kryo, final Input input, final String id,
        final String originalUrl, final String artifactId) {

    final String requestId = kryo.readObject(input, String.class);
    final String relayState = kryo.readObject(input, String.class);
    try {
        return (GoogleAccountsService) CONSTRUCTOR.newInstance(
                id,
                originalUrl,
                artifactId,
                relayState,
                requestId,
                this.privateKey,
                this.publicKey,
                this.alternateUsername);
    } catch (final Exception e) {
        throw new IllegalStateException("Error creating SamlService", e);
    }
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:21,代码来源:GoogleAccountsServiceSerializer.java

示例7: read

import com.esotericsoftware.kryo.io.Input; //导入依赖的package包/类
@Override
public Bmv2DeviceContext read(Kryo kryo, Input input, Class<Bmv2DeviceContext> type) {
    String jsonStr = kryo.readObject(input, String.class);
    String interpreterClassName = kryo.readObject(input, String.class);
    Bmv2Configuration configuration = parse(Json.parse(jsonStr).asObject());
    ClassLoader loader = interpreterClassLoaders.get(interpreterClassName);
    if (loader == null) {
        throw new IllegalStateException("No class loader registered for interpreter: " + interpreterClassName);
    }
    try {
        Bmv2Interpreter interpreter = (Bmv2Interpreter) loader.loadClass(interpreterClassName).newInstance();
        return new Bmv2DeviceContext(configuration, interpreter);
    } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
        throw new RuntimeException("Unable to load interpreter class", e);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:17,代码来源:Bmv2DeviceContextServiceImpl.java

示例8: read

import com.esotericsoftware.kryo.io.Input; //导入依赖的package包/类
@Override
public ExtensionCriterion read(Kryo kryo, Input input,
        Class<ExtensionCriterion> type) {
    ExtensionSelectorType exType = (ExtensionSelectorType) kryo.readClassAndObject(input);
    DeviceId deviceId = (DeviceId) kryo.readClassAndObject(input);

    DriverService driverService = DefaultServiceDirectory.getService(DriverService.class);
    DriverHandler handler = new DefaultDriverHandler(
            new DefaultDriverData(driverService.getDriver(deviceId), deviceId));

    ExtensionSelectorResolver resolver = handler.behaviour(ExtensionSelectorResolver.class);
    ExtensionSelector selector = resolver.getExtensionSelector(exType);

    byte[] bytes = (byte[]) kryo.readClassAndObject(input);
    selector.deserialize(bytes);
    return Criteria.extension(selector, deviceId);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:ExtensionCriterionSerializer.java

示例9: decode

import com.esotericsoftware.kryo.io.Input; //导入依赖的package包/类
@Override
public Object decode(ByteBuf buf, State state) throws IOException {
    Kryo kryo = null;
    try {
        kryo = kryoPool.get();
        return kryo.readClassAndObject(new Input(new ByteBufInputStream(buf)));
    } catch (Exception e) {
        if (e instanceof RuntimeException) {
            throw (RuntimeException) e;
        }
        throw new RedissonKryoCodecException(e);
    } finally {
        if (kryo != null) {
            kryoPool.yield(kryo);
        }
    }
}
 
开发者ID:qq1588518,项目名称:JRediClients,代码行数:18,代码来源:KryoCodec.java

示例10: read

import com.esotericsoftware.kryo.io.Input; //导入依赖的package包/类
@Override
public T read(Kryo kryo, Input input, Class<T> type) {
    int length = input.readVarInt(true);
    boolean ordered = input.readBoolean();
    Class cls = kryo.readClass(input).getType();
    T array = create(ordered, length, cls);
    kryo.reference(array);
    Class elementClass = null;
    Serializer serializer = null;
    if (genericType != null) {
        elementClass = genericType;
        serializer = kryo.getSerializer(genericType);
        genericType = null;
    }
    if (serializer != null) {
        for (int i = 0; i < length; i++)
            array.add(kryo.readObjectOrNull(input, elementClass, serializer));
    } else {
        for (int i = 0; i < length; i++)
            array.add(kryo.readClassAndObject(input));
    }
    return array;
}
 
开发者ID:CypherCove,项目名称:gdx-cclibs,代码行数:24,代码来源:ArraySerializer.java

示例11: read

import com.esotericsoftware.kryo.io.Input; //导入依赖的package包/类
public ArrayMetaData<byte[]> read(Kryo kryo, Input input, Class<ArrayMetaData<byte[]>> type) {
    try {
        byte[] arrData = arrayMetaData.getArrData();
        thatArrMetaData = arrayMetaData.recv(input);
        int arrSegNum = thatArrMetaData.getSegNum();
        for (int i = 0; i < arrSegNum; i++) {
            int from = thatArrMetaData.getFrom(i);
            int to = thatArrMetaData.getTo(i);
            for (int j = from; j < to; j++) {
                arrData[j] = input.readByte();
            }
        }
        thatArrMetaData.setArrData(arrData);
    } catch (IOException e) {
        LOG.error("double array read exception", e);
        System.exit(1);
    }
    return thatArrMetaData;

}
 
开发者ID:yuantiku,项目名称:ytk-mp4j,代码行数:21,代码来源:ByteOperand.java

示例12: read

import com.esotericsoftware.kryo.io.Input; //导入依赖的package包/类
public ArrayMetaData<String[]> read(Kryo kryo, Input input, Class<ArrayMetaData<String[]>> type) {
    try {
        String[] arrData = arrayMetaData.getArrData();
        thatArrMetaData = arrayMetaData.recv(input);
        int arrSegNum = thatArrMetaData.getSegNum();
        for (int i = 0; i < arrSegNum; i++) {
            int from = thatArrMetaData.getFrom(i);
            int to = thatArrMetaData.getTo(i);
            for (int j = from; j < to; j++) {
                arrData[j] = input.readString();
            }
        }
        thatArrMetaData.setArrData(arrData);
    } catch (IOException e) {
        LOG.error("double array read exception", e);
        System.exit(1);
    }
    return thatArrMetaData;

}
 
开发者ID:yuantiku,项目名称:ytk-mp4j,代码行数:21,代码来源:StringOperand.java

示例13: read

import com.esotericsoftware.kryo.io.Input; //导入依赖的package包/类
@Override
public final void read (Kryo kryo, Input input) {
    pushHeader(kryo, this);
    input.readInt(true); //if this class ever evolves, version can be used for backward compatibility
    Class dataType = kryo.readClass(input).getType();
    gdxMajorVersion = input.readInt(true);
    gdxMinorVersion = input.readInt(true);
    gdxRevisionVersion = input.readInt(true);
    writtenVersion = input.readInt(true);
    minimumReadVersion = input.readInt(true);
    minimumReadVersionString = input.readString();
    useCompactColor = input.readBoolean();
    includePixmapDrawingParams = input.readBoolean();
    readExtra(kryo, input);
    if (dataType != null && minimumReadVersion <= currentReadWriteVersion){
        data = (T)kryo.readObject(input, dataType);
    }
    popHeader(kryo);
}
 
开发者ID:CypherCove,项目名称:gdx-cclibs,代码行数:20,代码来源:GraphHeader.java

示例14: 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

示例15: readFromBytes

import com.esotericsoftware.kryo.io.Input; //导入依赖的package包/类
public T[] readFromBytes(Object origin, Input input, int slaveNum) {
    T[] originArr = (T[])origin;
    Kryo kryo = KryoUtils.getKryo();
    for (int i = 0; i < slaveNum; i++) {
        if (i == 0) {
            for (int j = 0; j < originArr.length; j++) {
                originArr[j] = (T)serializer.read(kryo, input, type);
            }
        } else {
            for (int j = 0; j < originArr.length; j++) {
                T readed = (T)serializer.read(kryo, input, type);
                originArr[j] = operator.apply(originArr[j], readed);
            }
        }
    }
    return originArr;
}
 
开发者ID:yuantiku,项目名称:ytk-mp4j,代码行数:18,代码来源:ObjectOperand.java


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