gpt4 book ai didi

hivemall.utils.codec.ZigZagLEB128Codec类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 10:22:29 28 4
gpt4 key购买 nike

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

ZigZagLEB128Codec介绍

暂无

代码示例

代码示例来源:origin: org.apache.hivemall/hivemall-core

public static void writeSignedInt(final int value, @Nonnull final DataOutput out)
    throws IOException {
  writeUnsignedInt(encode(value), out);
}

代码示例来源:origin: io.github.myui/hivemall-core

@Deprecated
public static float readFloat(@Nonnull final DataInput in) throws IOException {
  int bits = readSignedInt(in);
  return Float.intBitsToFloat(bits);
}

代码示例来源:origin: org.apache.hivemall/hivemall-core

public static int readSignedInt(@Nonnull final DataInput in) throws IOException {
  int raw = readUnsignedInt(in);
  int temp = (((raw << 31) >> 31) ^ raw) >> 1;
  return temp ^ (raw & (1 << 31));
}

代码示例来源:origin: io.github.myui/hivemall-core

public static void writeSignedLong(final long value, @Nonnull final DataOutput out)
    throws IOException {
  writeUnsignedLong(encode(value), out);
}

代码示例来源:origin: io.github.myui/hivemall-core

@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  this._threshold = in.readInt();
  this._used = in.readInt();
  final int size = in.readInt();
  final int[] keys = new int[size];
  final long[] values = new long[size];
  final byte[] states = new byte[size];
  readStates(in, states);
  for (int i = 0; i < size; i++) {
    if (states[i] != FULL) {
      continue;
    }
    keys[i] = ZigZagLEB128Codec.readSignedInt(in);
    values[i] = ZigZagLEB128Codec.readSignedLong(in);
  }
  this._keys = keys;
  this._values = values;
  this._states = states;
}

代码示例来源:origin: io.github.myui/hivemall-core

@Override
public void writeExternal(ObjectOutput out) throws IOException {
  out.writeInt(_threshold);
  out.writeInt(_used);
  final int[] keys = _keys;
  final int size = keys.length;
  out.writeInt(size);
  final byte[] states = _states;
  writeStates(states, out);
  final long[] values = _values;
  for (int i = 0; i < size; i++) {
    if (states[i] != FULL) {
      continue;
    }
    ZigZagLEB128Codec.writeSignedInt(keys[i], out);
    ZigZagLEB128Codec.writeSignedLong(values[i], out);
  }
}

代码示例来源:origin: io.github.myui/hivemall-core

@Deprecated
public static void writeFloat(final float value, final DataOutput out) throws IOException {
  int bits = Float.floatToIntBits(value);
  writeSignedInt(bits, out);
}

代码示例来源:origin: org.apache.hivemall/hivemall-core

public static long readSignedLong(@Nonnull final DataInput in) throws IOException {
  long raw = readUnsignedLong(in);
  long temp = (((raw << 63) >> 63) ^ raw) >> 1;
  return temp ^ (raw & (1L << 63));
}

代码示例来源:origin: io.github.myui/hivemall-core

@Deprecated
public static double readDouble(@Nonnull final DataInput in) throws IOException {
  long bits = readSignedLong(in);
  return Double.longBitsToDouble(bits);
}

代码示例来源:origin: org.apache.hivemall/hivemall-core

@Deprecated
public static void writeDouble(final double value, final DataOutput out) throws IOException {
  long bits = Double.doubleToLongBits(value);
  writeSignedLong(bits, out);
}

代码示例来源:origin: org.apache.hivemall/hivemall-core

public static void writeSignedLong(final long value, @Nonnull final DataOutput out)
    throws IOException {
  writeUnsignedLong(encode(value), out);
}

代码示例来源:origin: org.apache.hivemall/hivemall-core

@Deprecated
public static void writeFloat(final float value, final DataOutput out) throws IOException {
  int bits = Float.floatToIntBits(value);
  writeSignedInt(bits, out);
}

代码示例来源:origin: io.github.myui/hivemall-core

public static long readSignedLong(@Nonnull final DataInput in) throws IOException {
  long raw = readUnsignedLong(in);
  long temp = (((raw << 63) >> 63) ^ raw) >> 1;
  return temp ^ (raw & (1L << 63));
}

代码示例来源:origin: org.apache.hivemall/hivemall-core

@Deprecated
public static double readDouble(@Nonnull final DataInput in) throws IOException {
  long bits = readSignedLong(in);
  return Double.longBitsToDouble(bits);
}

代码示例来源:origin: io.github.myui/hivemall-core

@Deprecated
public static void writeDouble(final double value, final DataOutput out) throws IOException {
  long bits = Double.doubleToLongBits(value);
  writeSignedLong(bits, out);
}

代码示例来源:origin: io.github.myui/hivemall-core

public static void writeSignedInt(final int value, @Nonnull final DataOutput out)
    throws IOException {
  writeUnsignedInt(encode(value), out);
}

代码示例来源:origin: org.apache.hivemall/hivemall-core

@Deprecated
public static float readFloat(@Nonnull final DataInput in) throws IOException {
  int bits = readSignedInt(in);
  return Float.intBitsToFloat(bits);
}

代码示例来源:origin: org.apache.hivemall/hivemall-core

@Deprecated
public static void writeVFloats(@Nonnull final float[] floats, final int size,
    @Nonnull final DataOutput out) throws IOException {
  for (int i = 0; i < size; i++) {
    int bits = Float.floatToIntBits(floats[i]);
    ZigZagLEB128Codec.writeSignedInt(bits, out);
  }
}

代码示例来源:origin: io.github.myui/hivemall-core

public static int readSignedInt(@Nonnull final DataInput in) throws IOException {
  int raw = readUnsignedInt(in);
  int temp = (((raw << 31) >> 31) ^ raw) >> 1;
  return temp ^ (raw & (1 << 31));
}

代码示例来源:origin: org.apache.hivemall/hivemall-core

@Deprecated
@Nonnull
public static float[] readVFloats(@Nonnull final DataInput in, final int size)
    throws IOException {
  final float[] floats = new float[size];
  for (int i = 0; i < size; i++) {
    int bits = ZigZagLEB128Codec.readSignedInt(in);
    floats[i] = Float.intBitsToFloat(bits);
  }
  return floats;
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com