congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Input
Code IndexAdd Tabnine to your IDE (free)

How to use
Input
in
io.protostuff

Best Java code snippets using io.protostuff.Input (Showing top 20 results out of 315)

origin: protostuff/protostuff

  @Override
  protected void transfer(Pipe pipe, Input input, Output output)
      throws IOException
  {
    for (int number = input.readFieldNumber(wrappedSchema); number != 0; number = input
        .readFieldNumber(wrappedSchema))
    {
      final Field<T> field = fieldsMap.getFieldByNumber(number);
      if (field == null)
        input.handleUnknownField(number, wrappedSchema);
      else
        field.transfer(pipe, input, output, field.repeated);
    }
  }
}
origin: protostuff/protostuff

@Override
public String readString() throws IOException
{
  return input.readString();
}
origin: protostuff/protostuff

public void mergeFrom(Input input, A message) throws IOException
{
  for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
  {
    switch(number)
    {
      case 0:
        return;
      case 1:
        message.value = input.readInt32();
        break;
      default:
        input.handleUnknownField(number, this);
    }   
  }
}
origin: protostuff/protostuff

for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
      return;
    case 1:
      message.someInt = input.readInt32();
      break;
    case 2:
      message.someString = input.readString();
      break;
    case 3:
      message.someBaz = input.mergeObject(message.someBaz, Baz.getSchema());
      break;
    case 4:
      message.someEnum = Status.valueOf(input.readEnum());
      break;
    case 5:
      message.someBytes = input.readBytes();
      break;
    case 6:
      message.someBoolean = input.readBool();
      break;
    case 7:
      message.someFloat = input.readFloat();
      break;
    case 8:
      message.someDouble = input.readDouble();
      break;
    case 9:
      message.someLong = input.readInt64();
origin: protostuff/protostuff

@Override
public Object readFrom(Input input, Object owner) throws IOException
{
  if (ID_ARRAY_LEN != input.readFieldNumber(this))
    throw new ProtostuffException("Corrupt input.");
  final int len = input.readInt32();
  return primitive ? readPrimitiveFrom(input, owner, len) : 
      readBoxedFrom(input, owner, len);
}

origin: protostuff/protostuff

@Override
public void mergeFrom(Input input, Baz message) throws IOException
{
  for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
  {
    switch (number)
    {
      case 0:
        return;
      case 1:
        message.id = input.readInt32();
        break;
      case 2:
        message.name = input.readString();
        break;
      case 3:
        message.timestamp = input.readInt64();
        break;
      default:
        input.handleUnknownField(number, this);
    }
  }
}
origin: protostuff/protostuff

@Override
public void mergeFrom(Input input, PojoWithBiggerByteArray message) throws IOException
{
  for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
  {
    switch (number)
    {
      case 0:
        return;
      case 1:
        message.id = input.readInt32();
        break;
      case 2:
        message.b = input.readByteArray();
        break;
      case 3:
        message.ts = input.readInt64();
        break;
      default:
        input.handleUnknownField(number, this);
    }
  }
}
origin: protostuff/protostuff

@Override
public void mergeFrom(Input input, ClubFounder message) throws IOException
{
  for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
  {
    switch (number)
    {
      case 0:
        return;
      case 1:
        message.name = input.readString();
        break;
      case 2:
        message.club = input.mergeObject(message.club, Club.getSchema());
        break;
      default:
        input.handleUnknownField(number, this);
    }
  }
}
origin: protostuff/protostuff

public void mergeFrom(Input input, SampleClass message) throws IOException
{
  for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
  {
    switch (number)
    {
      case 0:
        return;
      case 1:
        if (message.testString == null)
          message.testString = new ArrayList<String>();
        message.testString.add(input.readString());
        break;
      default:
        input.handleUnknownField(number, this);
    }
  }
}
origin: protostuff/protostuff

@Override
public Object readFrom(Input input, Object owner) throws IOException
{
  if (ID_ARRAY_LEN != input.readFieldNumber(this))
    throw new ProtostuffException("Corrupt input.");
  final int len = input.readInt32();
  ByteString[] array = new ByteString[len];
  if (input instanceof GraphInput)
  {
    // update the actual reference.
    ((GraphInput) input).updateLast(array, owner);
  }
  for (int i = 0; i < len;)
  {
    switch (input.readFieldNumber(this))
    {
      case ID_ARRAY_DATA:
        array[i++] = input.readBytes();
        break;
      case ID_ARRAY_NULLCOUNT:
        i += input.readUInt32();
        break;
      default:
        throw new ProtostuffException("Corrupt input.");
    }
  }
  if (0 != input.readFieldNumber(this))
    throw new ProtostuffException("Corrupt input.");
  return array;
}
origin: protostuff/protostuff

@Override
public void mergeFrom(Input input, FPNumbers message) throws IOException
{
  for (int number = input.readFieldNumber(this); ; number = input.readFieldNumber(this))
  {
    switch (number)
    {
      case 0:
        return;
      case 1:
        message.floatValue = input.readFloat();
        break;
      case 2:
        message.doubleValue = input.readDouble();
        break;
      default:
        input.handleUnknownField(number, this);
    }
  }
}
origin: protostuff/protostuff

@Override
public void mergeFrom(Input input, WrapperPojo message) throws IOException
{
  for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
  {
    switch (number)
    {
      case 0:
        return;
      case 1:
        message.requiresName = input.mergeObject(message.requiresName, RequiresName.SCHEMA);
        break;
      default:
        input.handleUnknownField(number, this);
    }
  }
}
origin: protostuff/protostuff

@Override
public void mergeFrom(Input input, Bat message) throws IOException
{
  for (int number = input.readFieldNumber(this);; number = input
      .readFieldNumber(this))
  {
    switch (number)
    {
      case 0:
        return;
      case 1:
        message.id = input.readUInt32();
        break;
      default:
        input.handleUnknownField(number, this);
    }
  }
}
origin: protostuff/protostuff

protected Object readBoxedFrom(Input input, Object owner, int len)
    throws IOException
{
  final Boolean[] array = new Boolean[len];
  if (input instanceof GraphInput)
  {
    // update the actual reference.
    ((GraphInput) input).updateLast(array, owner);
  }
  for (int i = 0; i < len;)
  {
    switch (input.readFieldNumber(this))
    {
      case ID_ARRAY_DATA:
        array[i++] = input.readBool();
        break;
      case ID_ARRAY_NULLCOUNT:
        i += input.readUInt32();
        break;
      default:
        throw new ProtostuffException("Corrupt input.");
    }
  }
  if (0 != input.readFieldNumber(this))
    throw new ProtostuffException("Corrupt input.");
  return array;
}

origin: protostuff/protostuff

protected Object readBoxedFrom(Input input, Object owner, int len)
    throws IOException
{
  final Double[] array = new Double[len];
  if (input instanceof GraphInput)
  {
    // update the actual reference.
    ((GraphInput) input).updateLast(array, owner);
  }
  for (int i = 0; i < len;)
  {
    switch (input.readFieldNumber(this))
    {
      case ID_ARRAY_DATA:
        array[i++] = input.readDouble();
        break;
      case ID_ARRAY_NULLCOUNT:
        i += input.readUInt32();
        break;
      default:
        throw new ProtostuffException("Corrupt input.");
    }
  }
  if (0 != input.readFieldNumber(this))
    throw new ProtostuffException("Corrupt input.");
  return array;
}

origin: protostuff/protostuff

static void transferObject(Pipe.Schema<Object> pipeSchema, Pipe pipe,
    Input input, Output output, IdStrategy strategy) throws IOException
{
  transferObject(pipeSchema, pipe, input, output, strategy, 
      input.readFieldNumber(pipeSchema.wrappedSchema));
}
origin: protostuff/protostuff

protected Object readBoxedFrom(Input input, Object owner, int len)
    throws IOException
{
  final Long[] array = new Long[len];
  if (input instanceof GraphInput)
  {
    // update the actual reference.
    ((GraphInput) input).updateLast(array, owner);
  }
  for (int i = 0; i < len;)
  {
    switch (input.readFieldNumber(this))
    {
      case ID_ARRAY_DATA:
        array[i++] = input.readInt64();
        break;
      case ID_ARRAY_NULLCOUNT:
        i += input.readUInt32();
        break;
      default:
        throw new ProtostuffException("Corrupt input.");
    }
  }
  if (0 != input.readFieldNumber(this))
    throw new ProtostuffException("Corrupt input.");
  return array;
}
origin: protostuff/protostuff

@Override
protected Object kFrom(Input input,
    MapWrapper<Object, Object> wrapper) throws IOException
{
  return input.mergeObject(null, schemaK.getSchema());
}
origin: protostuff/protostuff

protected Object readPrimitiveFrom(Input input, Object owner, int len)
    throws IOException
{
  long[] array = new long[len];
  if (input instanceof GraphInput)
  {
    // update the actual reference.
    ((GraphInput) input).updateLast(array, owner);
  }
  for (int i = 0; i < len; i++)
  {
    if (ID_ARRAY_DATA != input.readFieldNumber(this))
      throw new ProtostuffException("Corrupt input.");
    array[i] = input.readInt64();
  }
  if (0 != input.readFieldNumber(this))
    throw new ProtostuffException("Corrupt input.");
  return array;
}

origin: protostuff/protostuff

protected Object readPrimitiveFrom(Input input, Object owner, int len)
    throws IOException
{
  boolean[] array = new boolean[len];
  if (input instanceof GraphInput)
  {
    // update the actual reference.
    ((GraphInput) input).updateLast(array, owner);
  }
  for (int i = 0; i < len; i++)
  {
    if (ID_ARRAY_DATA != input.readFieldNumber(this))
      throw new ProtostuffException("Corrupt input.");
    array[i] = input.readBool();
  }
  if (0 != input.readFieldNumber(this))
    throw new ProtostuffException("Corrupt input.");
  return array;
}

io.protostuffInput

Javadoc

An Input lets an application read primitive data types and objects from a source of data.

Most used methods

  • readFieldNumber
  • handleUnknownField
  • readString
  • mergeObject
  • readInt32
  • readInt64
  • readBool
  • readDouble
  • readBytes
    Reads a field value into a ByteBuffer.
  • readEnum
    Reads an enum(its number) field value.
  • readUInt32
  • readByteArray
  • readUInt32,
  • readByteArray,
  • readFloat,
  • readUInt64,
  • readFixed64,
  • transferByteRangeTo,
  • readSFixed64,
  • readFixed32,
  • readSFixed32,
  • readSInt32

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • findViewById (Activity)
  • startActivity (Activity)
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Reference (javax.naming)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now