Tabnine Logo
Schema.mergeFrom
Code IndexAdd Tabnine to your IDE (free)

How to use
mergeFrom
method
in
io.protostuff.Schema

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

origin: protostuff/protostuff

@Override
public void mergeFrom(Input input, T message) throws IOException
{
  schema.mergeFrom(input, message);
}
origin: protostuff/protostuff

/**
 * Merges the {@code message} from the {@link InputStream} using the given {@code schema}.
 */
static <T> void mergeFrom(InputStream in, T message, Schema<T> schema,
    boolean decodeNestedMessageAsGroup) throws IOException
{
  final CodedInput input = new CodedInput(in, decodeNestedMessageAsGroup);
  schema.mergeFrom(input, message);
  input.checkLastTagWas(0);
}
origin: protostuff/protostuff

@Override
public void mergeFrom(Input input, final Object message) throws IOException
{
  final Schema<Object> schema = lastSchema;
  // merge using this input.
  schema.mergeFrom(this, message);
  if (!schema.isInitialized(message))
    throw new UninitializedMessageException(message, schema);
  // restore
  lastSchema = schema;
}
origin: protostuff/protostuff

@Override
public void mergeFrom(Input input, final Object message) throws IOException
{
  final Schema<Object> schema = lastSchema;
  // merge using this input.
  schema.mergeFrom(this, message);
  if (!schema.isInitialized(message))
    throw new UninitializedMessageException(message, schema);
  // restore
  lastSchema = schema;
}
origin: protostuff/protostuff

/**
 * Merges the {@code message} from the JsonParser using the given {@code schema}.
 */
public static <T> void mergeFrom(MessageUnpacker unpacker, T message, Schema<T> schema, boolean numeric)
    throws IOException
{
  MsgpackParser parser = new MsgpackParser(unpacker, numeric);
  schema.mergeFrom(new MsgpackInput(parser), message);
}
origin: protostuff/protostuff

/**
 * Merges the {@code message} from the {@link InputStream} with the supplied {@code buf} to use.
 */
static <T> void mergeFrom(InputStream in, byte[] buf, T message, Schema<T> schema,
    boolean decodeNestedMessageAsGroup) throws IOException
{
  final CodedInput input = new CodedInput(in, buf, decodeNestedMessageAsGroup);
  schema.mergeFrom(input, message);
  input.checkLastTagWas(0);
}
origin: protostuff/protostuff

/**
 * Merges the {@code message} from the {@link InputStream} using the given {@code schema}.
 */
public static <T> void mergeFrom(InputStream in, T message, Schema<T> schema)
    throws IOException
{
  final CodedInput input = new CodedInput(in, true);
  final GraphCodedInput graphInput = new GraphCodedInput(input);
  schema.mergeFrom(graphInput, message);
  input.checkLastTagWas(0);
}
origin: protostuff/protostuff

/**
 * Merges the {@code message} from the {@link InputStream} using the given {@code schema}.
 * <p>
 * The {@code buffer}'s internal byte array will be used for reading the message.
 */
public static <T> void mergeFrom(InputStream in, T message, Schema<T> schema,
    LinkedBuffer buffer) throws IOException
{
  final CodedInput input = new CodedInput(in, buffer.buffer, true);
  final GraphCodedInput graphInput = new GraphCodedInput(input);
  schema.mergeFrom(graphInput, message);
  input.checkLastTagWas(0);
}
origin: protostuff/protostuff

private <T> T mergeObjectEncodedAsGroup(T value, final Schema<T> schema) throws IOException
{
  if (value == null)
    value = schema.newMessage();
  schema.mergeFrom(this, value);
  if (!schema.isInitialized(value))
    throw new UninitializedMessageException(value, schema);
  // handling is in #readFieldNumber
  checkLastTagWas(0);
  return value;
}
origin: protostuff/protostuff

private <T> T mergeObjectEncodedAsGroup(T value, final Schema<T> schema) throws IOException
{
  if (value == null)
    value = schema.newMessage();
  schema.mergeFrom(this, value);
  if (!schema.isInitialized(value))
    throw new UninitializedMessageException(value, schema);
  // handling is in #readFieldNumber
  checkLastTagWas(0);
  return value;
}
origin: fengjiachun/Jupiter

private <T> T mergeObjectEncodedAsGroup(T value, final Schema<T> schema) throws IOException {
  if (value == null) {
    value = schema.newMessage();
  }
  schema.mergeFrom(this, value);
  if (!schema.isInitialized(value)) {
    throw new UninitializedMessageException(value, schema);
  }
  // handling is in #readFieldNumber
  checkLastTagWas(0);
  return value;
}
origin: fengjiachun/Jupiter

private <T> T mergeObjectEncodedAsGroup(T value, final Schema<T> schema) throws IOException {
  if (value == null) {
    value = schema.newMessage();
  }
  schema.mergeFrom(this, value);
  if (!schema.isInitialized(value)) {
    throw new UninitializedMessageException(value, schema);
  }
  // handling is in #readFieldNumber
  checkLastTagWas(0);
  return value;
}
origin: fengjiachun/Jupiter

private <T> T mergeObjectEncodedAsGroup(T value, final Schema<T> schema) throws IOException {
  if (value == null) {
    value = schema.newMessage();
  }
  schema.mergeFrom(this, value);
  if (!schema.isInitialized(value)) {
    throw new UninitializedMessageException(value, schema);
  }
  // handling is in #readFieldNumber
  checkLastTagWas(0);
  return value;
}
origin: fengjiachun/Jupiter

private <T> T mergeObjectEncodedAsGroup(T value, final Schema<T> schema) throws IOException {
  if (value == null) {
    value = schema.newMessage();
  }
  schema.mergeFrom(this, value);
  if (!schema.isInitialized(value)) {
    throw new UninitializedMessageException(value, schema);
  }
  // handling is in #readFieldNumber
  checkLastTagWas(0);
  return value;
}
origin: protostuff/protostuff

@Override
public <T> T mergeObject(T value, Schema<T> schema) throws IOException
{
  if (value == null)
  {
    value = schema.newMessage();
  }
  MsgpackParser innerParser = new MsgpackParser(this.parser);
  MsgpackParser thisParser = use(innerParser);
  schema.mergeFrom(this, value);
  use(thisParser);
  return value;
}
origin: protostuff/protostuff

private void deserTest(Message origMsg,
    Schema sch,
    ByteBuffer buf) throws IOException
{
  ByteBufferInput input = new ByteBufferInput(buf, true);
  Object newM = sch.newMessage();
  sch.mergeFrom(input, newM);
  assertEquals(origMsg, newM);
}
origin: protostuff/protostuff

@Override
public <T extends Message<T>> void mergeFrom(byte[] data, T message) throws IOException
{
  final CodedInput input = new CodedInput(data, 0, data.length, true);
  message.cachedSchema().mergeFrom(input, message);
  input.checkLastTagWas(0);
}
origin: protostuff/protostuff

@Override
public <T extends Message<T>> void mergeFrom(byte[] data, T message) throws IOException
{
  final CodedInput input = new CodedInput(data, 0, data.length, false);
  message.cachedSchema().mergeFrom(input, message);
  input.checkLastTagWas(0);
}
origin: protostuff/protostuff

private void deserTest(Message origMsg,
    Schema sch,
    ByteBuffer buf) throws IOException
{
  ByteBufferInput input = new ByteBufferInput(buf, false);
  Object newM = sch.newMessage();
  sch.mergeFrom(input, newM);
  assertEquals(origMsg, newM);
}
origin: protostuff/protostuff

@Override
protected <T> void mergeFrom(byte[] data, int offset, int length, T message, Schema<T> schema)
    throws IOException
{
  final CodedInput input = new CodedInput(data, offset, length, false);
  schema.mergeFrom(input, message);
  input.checkLastTagWas(0);
  assertTrue(input.isAtEnd());
}
io.protostuffSchemamergeFrom

Javadoc

Deserializes a message/object from the Input.

Popular methods of Schema

  • newMessage
  • writeTo
  • isInitialized
  • getFieldName
  • typeClass
  • getFieldNumber
  • messageFullName
  • messageName
    Returns the simple name of the message tied to this schema. Allows custom schemas to provide a custo

Popular in Java

  • Running tasks concurrently on multiple threads
  • addToBackStack (FragmentTransaction)
  • compareTo (BigDecimal)
  • onCreateOptionsMenu (Activity)
  • Menu (java.awt)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • JComboBox (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Table (org.hibernate.mapping)
    A relational table
  • Top PhpStorm 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