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

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

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

Output.writeString介绍

[英]Writes a String field.
[中]写入字符串字段。

代码示例

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

@Override
public void writeTo(Output output, int number, String value,
    boolean repeated) throws IOException
{
  output.writeString(number, (CharSequence) value, repeated);
}

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

@Override
public void writeString(int fieldNumber, CharSequence value, boolean repeated) throws IOException
{
  output.writeString(fieldNumber, value, repeated);
}

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

@Override
public void writeTo(Output output, int number, String value,
    boolean repeated) throws IOException
{
  output.writeString(number, (CharSequence) value, repeated);
}

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

@Override
protected void writeValueTo(Output output, int fieldNumber, String value,
    boolean repeated) throws IOException
{
  output.writeString(fieldNumber, (CharSequence) value, repeated);
}

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

@Override
protected final void writeKeyTo(Output output, int fieldNumber, String value,
    boolean repeated) throws IOException
{
  output.writeString(fieldNumber, (CharSequence) value, repeated);
}

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

@Override
public void writeTo(Output output, int number, BigDecimal value,
    boolean repeated) throws IOException
{
  output.writeString(number, value.toString(), repeated);
}

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

@Override
protected void writeEnumIdTo(Output output, int fieldNumber, Class<?> clazz)
    throws IOException
{
  output.writeString(fieldNumber, clazz.getName(), false);
}

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

@Override
public void writeTo(Output output, int number, BigDecimal value,
    boolean repeated) throws IOException
{
  output.writeString(number, value.toString(), repeated);
}

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

@Override
protected void writeClassIdTo(Output output, Class<?> componentType,
    boolean array) throws IOException
{
  final int id = array ? RuntimeFieldFactory.ID_CLASS_ARRAY
      : RuntimeFieldFactory.ID_CLASS;
  output.writeString(id, componentType.getName(), false);
}

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

@Override
protected void writeArrayIdTo(Output output, Class<?> componentType)
    throws IOException
{
  output.writeString(RuntimeFieldFactory.ID_ARRAY,
      componentType.getName(), false);
}

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

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

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

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

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

@Override
protected void writeValueTo(Output output, int fieldNumber, String value, boolean repeated) throws IOException
{
  output.writeString(fieldNumber, value, repeated);
}

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

@Override
protected <T> HasSchema<T> writePojoIdTo(Output output, int fieldNumber,
    Class<T> clazz) throws IOException
{
  output.writeString(fieldNumber, clazz.getName(), false);
  // it is important to return the schema initialized (if it hasn't been).
  return getSchemaWrapper(clazz, true);
}

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

@Override
public void writeTo(Output output, RequiresName message) throws IOException
{
  if (message.name != null)
    output.writeString(1, (CharSequence) message.name, false);
  if (message.description != null)
    output.writeString(2, (CharSequence) message.description, false);
}

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

@Override
protected <T> HasSchema<T> writePojoIdTo(Output output, int fieldNumber,
    Class<T> clazz) throws IOException
{
  output.writeString(fieldNumber, clazz.getName(), false);
  // it is important to return the schema initialized (if it hasn't been).
  return getSchemaWrapper(clazz, true);
}

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

@Override
public void writeTo(Output output, HasHasBar message) throws IOException
{
  if (message.name != null)
    output.writeString(1, message.name, false);
  writeHasBar(output, 2, message.hasBar, false);
}

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

@Override
public void transferByteRangeTo(Output output, boolean utf8String, int fieldNumber,
    boolean repeated) throws IOException
{
  if (utf8String)
    output.writeString(fieldNumber, readString(), repeated);
  else
    output.writeByteArray(fieldNumber, readByteArray(), repeated);
}

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

@Override
public void writeTo(Output output, Baz message) throws IOException
{
  if (message.id != 0)
    output.writeInt32(1, message.id, false);
  if (message.name != null)
    output.writeString(2, message.name, false);
  if (message.timestamp != 0l)
    output.writeInt64(3, message.timestamp, false);
}

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

@Override
public void writeTo(Output output, ClubFounder message) throws IOException
{
  if (message.name != null)
    output.writeString(1, message.name, false);
  if (message.club != null)
    output.writeObject(2, message.club, Club.getSchema(), false);
}

相关文章