com.esotericsoftware.kryo.io.Input.readShorts()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中com.esotericsoftware.kryo.io.Input.readShorts()方法的一些代码示例,展示了Input.readShorts()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Input.readShorts()方法的具体详情如下:
包路径:com.esotericsoftware.kryo.io.Input
类名称:Input
方法名:readShorts

Input.readShorts介绍

[英]Bulk input of a short array.
[中]短数组的批量输入。

代码示例

代码示例来源:origin: com.esotericsoftware/kryo

/** Bulk input of a short array. */
public short[] readShorts (int length) throws KryoException {
  if (capacity - position >= length * 2 && isNativeOrder()) {
    short[] array = new short[length];
    ShortBuffer buf = niobuffer.asShortBuffer();
    buf.get(array);
    position += length * 2;
    niobuffer.position(position);
    return array;
  } else
    return super.readShorts(length);
}

代码示例来源:origin: com.esotericsoftware/kryo

public short[] read (Kryo kryo, Input input, Class<short[]> type) {
  int length = input.readVarInt(true);
  if (length == NULL) return null;
  return input.readShorts(length - 1);
}

代码示例来源:origin: com.esotericsoftware/kryo-shaded

/** Bulk input of a short array. */
public short[] readShorts (int length) throws KryoException {
  if (capacity - position >= length * 2 && isNativeOrder()) {
    short[] array = new short[length];
    ShortBuffer buf = niobuffer.asShortBuffer();
    buf.get(array);
    position += length * 2;
    niobuffer.position(position);
    return array;
  } else
    return super.readShorts(length);
}

代码示例来源:origin: com.esotericsoftware.kryo/kryo

/** Bulk input of a short array. */
public short[] readShorts (int length) throws KryoException {
  if (capacity - position >= length * 2 && isNativeOrder()) {
    short[] array = new short[length];
    ShortBuffer buf = niobuffer.asShortBuffer();
    buf.get(array);
    position += length * 2;
    niobuffer.position(position);
    return array;
  } else
    return super.readShorts(length);
}

代码示例来源:origin: com.esotericsoftware.kryo/kryo

public short[] read (Kryo kryo, Input input, Class<short[]> type) {
  int length = input.readVarInt(true);
  if (length == NULL) return null;
  return input.readShorts(length-1);
}

代码示例来源:origin: com.esotericsoftware/kryo-shaded

public short[] read (Kryo kryo, Input input, Class<short[]> type) {
  int length = input.readVarInt(true);
  if (length == NULL) return null;
  return input.readShorts(length - 1);
}

代码示例来源:origin: svn2github/kryo

public short[] read (Kryo kryo, Input input, Class<short[]> type) {
  int length = input.readVarInt(true);
  if (length == NULL) return null;
  return input.readShorts(length-1);
}

代码示例来源:origin: svn2github/kryo

/** Bulk input of a short array. */
public short[] readShorts (int length) throws KryoException {
  if (capacity - position >= length * 2 && isNativeOrder()) {
    short[] array = new short[length];
    ShortBuffer buf = niobuffer.asShortBuffer();
    buf.get(array);
    position += length * 2;
    niobuffer.position(position);
    return array;
  } else
    return super.readShorts(length);
}

代码示例来源:origin: apache/apex-malhar

case "short":
 NDArray<short[]> shortNDArray = new NDArray<>(
   input.readShorts(singleDimensionArrayLength),signedFlag,dimensions);
 return shortNDArray;
case "byte":
 return byteNDArray;
case "boolean":
 short[] shortsArray = input.readShorts(singleDimensionArrayLength);
 boolean[] boolsArray = new boolean[shortsArray.length];
 for (int i = 0; i < shortsArray.length; i++) {

相关文章

微信公众号

最新文章

更多