io.protostuff.Output.writeUInt32()方法的使用及代码示例

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

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

Output.writeUInt32介绍

[英]Writes an unsigned int field.
[中]

代码示例

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

@Override
public void writeTo(Output output, int number, Character value,
    boolean repeated) throws IOException
{
  output.writeUInt32(number, value.charValue(), repeated);
}

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

@Override
public void writeTo(Output output, int number, Character value,
    boolean repeated) throws IOException
{
  output.writeUInt32(number, value.charValue(), repeated);
}

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

@Override
public void writeTo(Output output, int number, Short value,
    boolean repeated) throws IOException
{
  output.writeUInt32(number, value.shortValue(), repeated);
}

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

@Override
public void writeTo(Output output, int number, Byte value,
    boolean repeated) throws IOException
{
  output.writeUInt32(number, value.byteValue(), repeated);
}

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

@Override
@SuppressWarnings("unchecked")
protected <T> HasSchema<T> tryWritePojoIdTo(Output output, int fieldNumber, 
    Class<T> clazz, boolean registered) throws IOException
{
  final BaseHS<T> wrapper = (BaseHS<T>) pojoMapping.get(clazz);
  if (wrapper != null)
    output.writeUInt32(fieldNumber, wrapper.id, false);
  
  return wrapper;
}

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

@Override
public void writeTo(Output output, int number, Byte value,
    boolean repeated) throws IOException
{
  output.writeUInt32(number, value.byteValue(), repeated);
}

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

@Override
@SuppressWarnings("unchecked")
protected <T> HasDelegate<T> tryWriteDelegateIdTo(Output output, int fieldNumber,
    Class<T> clazz) throws IOException
{
  final RegisteredDelegate<T> rd = (RegisteredDelegate<T>) delegateMapping.get(
      clazz);
  if (rd == null)
    return null;
  output.writeUInt32(fieldNumber, rd.id, false);
  return rd;
}

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

@Override
public void writeTo(Output output, int number, Short value,
    boolean repeated) throws IOException
{
  output.writeUInt32(number, value.shortValue(), repeated);
}

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

@Override
public void transfer(Pipe pipe, Input input, Output output, int number,
    boolean repeated) throws IOException
{
  output.writeUInt32(number, input.readUInt32(), repeated);
}

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

@Override
protected void writeMapIdTo(Output output, int fieldNumber, Class<?> clazz)
    throws IOException
{
  final RegisteredMapFactory factory = mapMapping.get(clazz);
  if (factory == null)
    throw new UnknownTypeException("map: " + clazz);
  output.writeUInt32(fieldNumber, factory.id, false);
}

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

@Override
public void transfer(Pipe pipe, Input input, Output output, int number,
    boolean repeated) throws IOException
{
  output.writeUInt32(number, input.readUInt32(), repeated);
}

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

@Override
public void transfer(Pipe pipe, Input input, Output output, int number,
    boolean repeated) throws IOException
{
  output.writeUInt32(number, input.readUInt32(), repeated);
}

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

@Override
protected void writeEnumIdTo(Output output, int fieldNumber, Class<?> clazz)
    throws IOException
{
  int id;
  RuntimeEnumIO reio = getRuntimeEnumIO(clazz);
  // wait till everything is completely set
  while (0 == (id = reio.id))
    LockSupport.parkNanos(1);
  output.writeUInt32(fieldNumber, id, false);
}

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

@Override
public void transfer(Pipe pipe, Input input, Output output, int number,
    boolean repeated) throws IOException
{
  output.writeUInt32(number, input.readUInt32(), repeated);
}

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

@Override
public void writeTo(Output output, Bat message) throws IOException
{
  output.writeUInt32(1, message.id, false);
}

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

@Override
@SuppressWarnings("unchecked")
protected <T> HasSchema<T> writePojoIdTo(Output output, int fieldNumber, Class<T> clazz)
    throws IOException
{
  final BaseHS<T> wrapper = (BaseHS<T>) pojoMapping.get(clazz);
  if (wrapper == null)
    throw new UnknownTypeException("pojo: " + clazz);
  output.writeUInt32(fieldNumber, wrapper.id, false);
  return wrapper;
}

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

@Override
protected void transferCollectionId(Input input, Output output, int fieldNumber)
    throws IOException
{
  output.writeUInt32(fieldNumber, input.readUInt32(), false);
}

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

@Override
@SuppressWarnings("unchecked")
protected <T> Schema<T> writeMessageIdTo(Output output, int fieldNumber,
    Message<T> message) throws IOException
{
  final BaseHS<T> wrapper = (BaseHS<T>) pojoMapping.get(message.getClass());
  if (wrapper == null)
    throw new UnknownTypeException("pojo: " + message.getClass());
  output.writeUInt32(fieldNumber, wrapper.id, false);
  // TODO allow the wrapper to return an override schema?
  return message.cachedSchema();
}

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

@Override
@SuppressWarnings("unchecked")
protected <T> HasSchema<T> transferPojoId(Input input, Output output,
    int fieldNumber) throws IOException
{
  final int id = input.readUInt32();
  final BaseHS<T> wrapper = (BaseHS<T>) pojos.get(id);
  if (wrapper == null)
    throw new UnknownTypeException("pojo id: " + id + " (Outdated registry)");
  output.writeUInt32(fieldNumber, id, false);
  return wrapper;
}

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

@Override
protected void transferArrayId(Input input, Output output, int fieldNumber,
    boolean mapped) throws IOException
{
  if (mapped)
    input.transferByteRangeTo(output, true, fieldNumber, false);
  else
    output.writeUInt32(fieldNumber, input.readUInt32(), false);
}

相关文章