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

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

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

Output.writeByte介绍

[英]Writes the bytes. Note the byte[] length is not written.
[中]写入字节。请注意,字节[]长度未写入。

代码示例

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

@Override
public void writeByte(byte v) throws IOException {
  output.writeByte(v);
}

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

@Override
public void writeByte(byte v) throws IOException {
  output.writeByte(v);
}

代码示例来源:origin: EsotericSoftware/kryonet

public void write (Kryo kryo, Output output) {
  output.writeInt(objectID, true);
  output.writeInt(cachedMethod.methodClassID, true);
  output.writeByte(cachedMethod.methodIndex);
  Serializer[] serializers = cachedMethod.serializers;
  Object[] args = this.args;
  for (int i = 0, n = serializers.length; i < n; i++) {
    Serializer serializer = serializers[i];
    if (serializer != null)
      kryo.writeObjectOrNull(output, args[i], serializer);
    else
      kryo.writeClassAndObject(output, args[i]);
  }
  output.writeByte(responseData);
}

代码示例来源:origin: orbit/orbit

private static void writePayload(Kryo kryo, Output out, Message message)
{
  if (message.getPayload() instanceof Object[])
  {
    out.writeByte(PayloadType.OBJECT_ARRAY.id);
    kryo.writeObject(out, message.getPayload());
    return;
  }
  if (message.getPayload() == null)
  {
    out.writeByte(PayloadType.NULL.id);
    return;
  }
  out.writeByte(PayloadType.UNKNOWN.id);
  kryo.writeClassAndObject(out, message.getPayload());
}

代码示例来源:origin: orbit/orbit

private static void writeHeaders(Kryo kryo, Output out, Map<String, Object> headers)
{
  if (headers == null || headers.isEmpty())
  {
    out.writeInt(0);
    return;
  }
  out.writeInt(headers.size());
  for (Map.Entry<String, Object> entry : headers.entrySet())
  {
    out.writeString(entry.getKey());
    ValueType valueType = ValueType.getType(entry.getValue());
    out.writeByte(valueType.id);
    if (valueType.equals(ValueType.STRING))
    {
      out.writeString(String.valueOf(entry.getValue()));
    }
    else if (valueType.equals(ValueType.INT))
    {
      out.writeInt((Integer) entry.getValue());
    }
    else
    {
      kryo.writeClassAndObject(out, entry.getValue());
    }
  }
}

代码示例来源:origin: orbit/orbit

private static void writeObjectId(Kryo kryo, Output out, Message message)
{
  ValueType valueTypeForObjectId = ValueType.getType(message.getObjectId());
  out.writeByte(valueTypeForObjectId.id);
  if (valueTypeForObjectId.equals(ValueType.STRING))
  {
    out.writeString(String.valueOf(message.getObjectId()));
  }
  else if (valueTypeForObjectId.equals(ValueType.INT))
  {
    out.writeInt((Integer) message.getObjectId());
  }
  else
  {
    kryo.writeClassAndObject(out, message.getObjectId());
  }
}

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

@Override
public void writeByte(final byte b) {
  unshadedOutput.writeByte(b);
}

代码示例来源:origin: DataSystemsLab/GeoSpark

private void writeType(Output output, Type type)
  {
    output.writeByte((byte) type.id);
  }
}

代码示例来源:origin: org.datasyslab/geospark

private void writeType(Output out, Type type)
{
  out.writeByte((byte) type.id);
}

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

public void write (Kryo kryo, Output output, Class object) {
  kryo.writeClass(output, object);
  output.writeByte((object != null && object.isPrimitive()) ? 1 : 0);
}

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

public void write (Kryo kryo, Output out, MonthDay obj) {
  out.writeByte(obj.getMonthValue());
  out.writeByte(obj.getDayOfMonth());
}

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

static void write (Output out, LocalDate date) {
  out.writeInt(date.getYear(), true);
  out.writeByte(date.getMonthValue());
  out.writeByte(date.getDayOfMonth());
}

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

static void write (Output out, ZoneOffset obj) {
  final int offsetSecs = obj.getTotalSeconds();
  int offsetByte = offsetSecs % 900 == 0 ? offsetSecs / 900 : 127; // compress to -72 to +72
  out.writeByte(offsetByte);
  if (offsetByte == 127) {
    out.writeInt(offsetSecs);
  }
}

代码示例来源:origin: eu.stratosphere/stratosphere-util

@Override
public void write(final Kryo kryo, final Output output) {
  kryo.writeObject(output, this.name);
  output.writeInt(this.originalSignatures.size());
  for (final Entry<Signature, MemberType> entry : this.originalSignatures.entrySet()) {
    output.writeByte(SignatureTypes.indexOf(entry.getKey().getClass()));
    kryo.writeObject(output, entry.getKey());
    kryo.writeObject(output, entry.getValue().getName());
    kryo.writeObject(output, entry.getValue().getDeclaringClass());
    kryo.writeObject(output, this.getParameterTypes(entry.getValue()));
  }
}

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

static void write (Output out, LocalDate date) {
  out.writeInt(date.getYear(), true);
  out.writeByte(date.getMonthValue());
  out.writeByte(date.getDayOfMonth());
}

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

static void write (Output out, ZoneOffset obj) {
  final int offsetSecs = obj.getTotalSeconds();
  int offsetByte = offsetSecs % 900 == 0 ? offsetSecs / 900 : 127; // compress to -72 to +72
  out.writeByte(offsetByte);
  if (offsetByte == 127) {
    out.writeInt(offsetSecs);
  }
}

代码示例来源:origin: pl.touk.esp/esp-process

static void write(Output out, LocalDate date) {
  out.writeInt(date.getYear(), true);
  out.writeByte(date.getMonthValue());
  out.writeByte(date.getDayOfMonth());
}

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

public void write (Output output, Object object) {
  try {
    output.writeByte(field.getByte(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.writeByte(field.getByte(object));
  } catch (Exception e) {
    KryoException ex = new KryoException(e);
    ex.addTrace(this + " (" + type.getName() + ")");
    throw ex;
  }
}

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

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

相关文章