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

x33g5p2x  于2022-01-25 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(168)

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

Output.writeShort介绍

[英]Writes a 2 byte short. Uses BIG_ENDIAN byte order.
[中]写入一个2字节的短字符。使用BIG_ENDIAN字节顺序。

代码示例

代码示例来源:origin: apache/incubator-dubbo

@Override
public void writeShort(short v) throws IOException {
  output.writeShort(v);
}

代码示例来源:origin: apache/incubator-dubbo

@Override
public void writeShort(short v) throws IOException {
  output.writeShort(v);
}

代码示例来源:origin: apache/flink

@Override
public void write(Kryo kryo, Output output, PyLong object) {
  byte[] data = object.getValue().toByteArray();
  output.writeShort(data.length);
  output.writeBytes(data);
}

代码示例来源:origin: apache/tinkerpop

@Override
public void writeShort(int s) {
  unshadedOutput.writeShort(s);
}

代码示例来源:origin: apache/metron

@Override
public void write(Kryo kryo, Output output) {
 int numVariableMappings = variableMappings.isEmpty()?0:variableMappings.size();
 output.writeShort(numVariableMappings);
 for(Map m : variableMappings) {
  byte[] b = m == null?new byte[]{}:SerDeUtils.toBytes(m);
  output.writeInt(b.length);
  if(b.length > 0) {
   output.writeBytes(b);
  }
 }
}

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

/** Bulk output of a short array. */
public void writeShorts (short[] object) throws KryoException {
  for (int i = 0, n = object.length; i < n; i++)
    writeShort(object[i]);
}

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

/** Bulk output of a short array. */
public void writeShorts (short[] object) throws KryoException {
  for (int i = 0, n = object.length; i < n; i++)
    writeShort(object[i]);
}

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

/** Bulk output of a short array. */
public void writeShorts (short[] object) throws KryoException {
  for (int i = 0, n = object.length; i < n; i++)
    writeShort(object[i]);
}

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

/** Bulk output of a short array. */
public void writeShorts (short[] object) throws KryoException {
  for (int i = 0, n = object.length; i < n; i++)
    writeShort(object[i]);
}

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

public void writeShort (int v) throws IOException {
  output.writeShort(v);
}

代码示例来源:origin: junkdog/artemis-odb

@Override
public void write (Kryo kryo, Output output, SaveFileFormat.ComponentIdentifiers ci) {
  int count = 0;
  for (Map.Entry<Integer, Class<? extends Component>> entry : ci.idToType.entrySet()) {
    count++;
  }
  output.writeShort(count);
  for (Map.Entry<Integer, Class<? extends Component>> entry : ci.idToType.entrySet()) {
    output.writeShort(entry.getKey().intValue());
    output.writeString(entry.getValue().getName());
  }
}

代码示例来源:origin: net.onedaybeard.artemis/artemis-odb-serializer-kryo

@Override
public void write (Kryo kryo, Output output, SaveFileFormat.ComponentIdentifiers ci) {
  int count = 0;
  for (Map.Entry<Integer, Class<? extends Component>> entry : ci.idToType.entrySet()) {
    count++;
  }
  output.writeShort(count);
  for (Map.Entry<Integer, Class<? extends Component>> entry : ci.idToType.entrySet()) {
    output.writeShort(entry.getKey().intValue());
    output.writeString(entry.getValue().getName());
  }
}

代码示例来源:origin: junkdog/artemis-odb

@Override
public void write (Kryo kryo, Output output, ArchetypeMapper.TransmuterEntry te) {
  int count = te.componentTypes.size();
  output.writeInt(count);
  for (int i = 0; i < count; i++) {
    Class<? extends Component> type = te.componentTypes.get(i);
    int index = identifiers.typeToId.get(type);
    output.writeShort(index);
  }
}

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

public void write (Output output, Object object) {
  output.writeShort(unsafe().getShort(object, offset));
}

代码示例来源:origin: net.onedaybeard.artemis/artemis-odb-serializer-kryo

@Override
public void write (Kryo kryo, Output output, ArchetypeMapper.TransmuterEntry te) {
  int count = te.componentTypes.size();
  output.writeInt(count);
  for (int i = 0; i < count; i++) {
    Class<? extends Component> type = te.componentTypes.get(i);
    int index = identifiers.typeToId.get(type);
    output.writeShort(index);
  }
}

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

public void write (Output output, Object object) {
  try {
    output.writeShort(field.getShort(object));
  } catch (Exception e) {
    KryoException ex = new KryoException(e);
    ex.addTrace(this + " (" + type.getName() + ")");
    throw ex;
  }
}

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

public void write (Output output, Object object) {
  try {
    output.writeShort(field.getShort(object));
  } catch (Exception e) {
    KryoException ex = new KryoException(e);
    ex.addTrace(this + " (" + type.getName() + ")");
    throw ex;
  }
}

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

public void write (Output output, Object object) {
  try {
    output.writeShort(field.getShort(object));
  } catch (Exception e) {
    KryoException ex = new KryoException(e);
    ex.addTrace(this + " (" + type.getName() + ")");
    throw ex;
  }
}

代码示例来源:origin: org.scray/scray-client-jdbc

@Override
public void write(Kryo k, Output o, JavaSimpleRow v) {
  o.writeShort(v.getColumns().size());
  for (JavaRowColumn<?> rowcol : v.getColumns()) {
    k.writeObject(o, rowcol);
  }
}

代码示例来源:origin: org.onosproject/onos-core-serializers

@Override
public void write(Kryo kryo, Output output, DefaultApplicationId object) {
  output.writeShort(object.id());
  output.writeString(object.name());
}

相关文章