Serializes the {@code messages} into the writer using the given schema.
503032
public static <T> void writeListTo(Writer writer, List<T> messages, Schema<T> schema,
            boolean numeric) throws IOException
    {
        final JsonGenerator generator = DEFAULT_JSON_FACTORY.createJsonGenerator(writer);
        try
        {
            writeListTo(generator, messages, schema, numeric);
        }
        finally
        {
            generator.close();
        }
    }
1049901
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);
    }
733274
static void loadSchemas(MessageStore msgStore, long[] schemaIds) throws MessageRestoreFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "loadSchemas");
    try {
      // Get the SchemaStore reference, creating a new one if necessary
      SchemaStoreItemStream schemaStore = getSchemaStore(msgStore);

      // Check for any unknown schemas
      for (int i = 0; i < schemaIds.length; i++) {
        if (JMFRegistry.instance.retrieve(schemaIds[i]) == null) {
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Restoring schema:" + schemaIds[i]);
          JMFRegistry.instance.register(schemaStore.findSchema(schemaIds[i]));
        }
      }
    } catch (MessageStoreException e) {
      FFDCFilter.processException(e, "loadSchemas", "105");
      throw new MessageRestoreFailedException(e);
    } catch (JMFException e) {
      FFDCFilter.processException(e, "loadSchemas", "108");
      throw new MessageRestoreFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "loadSchemas");
  }
467860
@Override
    public void exportSchema(final String persistenceUnit, List<TableInfo> schemas)
    {
        super.exportSchema(persistenceUnit, schemas);
    }
577026
public Csv schema(TypeInformation<Row> schemaType) {
		Preconditions.checkNotNull(schemaType);
		internalProperties.putString(FORMAT_SCHEMA, TypeStringUtils.writeTypeInfo(schemaType));
		return this;
	}
148091
public static <T> int writeTo(OutputStream out, T message, Schema<T> schema,
            LinkedBuffer buffer) throws IOException
    {
        if (buffer.start != buffer.offset)
            throw new IllegalArgumentException("Buffer previously used and had not been reset.");

        final YamlOutput output = new YamlOutput(buffer, out, schema);

        output.tail = YamlOutput.writeTag(
                schema.messageName(),
                false,
                output.sink,
                output,
                output.sink.writeByteArray(
                        START_DIRECTIVE,
                        output,
                        buffer));

        schema.writeTo(output, message);

        LinkedBuffer.writeTo(out, buffer);

        return output.getSize();
    }
1295033
public static String serialize(StreamSchema schema) {
    StringBuilder builder = new StringBuilder();
    int fieldCount = 1;
    for (GDATField field : schema.getFields()) {
      builder.append(field.getType().getTypeName()).append(" ").append(field.getName()).append(" get_gdat_")
        .append(field.getType().getTypeName()).append("_pos").append(fieldCount);
      builder.append(field.getSlidingWindowType().getAttribute());
      builder.append(";").append(Constants.NEWLINE);
      fieldCount++;
    }
    return builder.toString();
  }
1141613
public static <T> void writeTo(Writer writer, T message, Schema<T> schema,
            boolean numeric) throws IOException
    {
        final JsonGenerator generator = DEFAULT_JSON_FACTORY.createJsonGenerator(writer);
        try
        {
            writeTo(generator, message, schema, numeric);
        }
        finally
        {
            generator.close();
        }
    }
108915
public static <T> void mergeFrom(byte[] data, int offset, int length, T message, 
            Schema<T> schema, boolean numeric) throws IOException
    {
        final IOContext context = new IOContext(DEFAULT_SMILE_FACTORY._getBufferRecycler(), 
                data, false);
        final SmileParser parser = newSmileParser(null, data, offset, offset+length, false, 
                context);
        
        //final SmileParser parser = DEFAULT_SMILE_FACTORY.createJsonParser(data, offset, length);
        try
        {
            JsonIOUtil.mergeFrom(parser, message, schema, numeric);
        }
        finally
        {
            parser.close();
        }
    }
423095
public static int writeListTo(final OutputStream out, final Vector messages, 
            final Schema schema, final LinkedBuffer buffer) throws IOException
    {
        if(buffer.start != buffer.offset)
            throw new IllegalArgumentException("Buffer previously used and had not been reset.");
        
        final int size = messages.size();
        if(size == 0)
            return 0;
        
        final ProtostuffOutput output = new ProtostuffOutput(buffer, out);
        output.sink.writeVarInt32(size, output, buffer);

        for(int i = 0; i < messages.size(); i++)
        {
        	Object m = messages.elementAt(i);
            schema.writeTo(output, m);
            output.sink.writeByte((byte)WireFormat.WIRETYPE_TAIL_DELIMITER, output, 
                    buffer);
        }
        
        LinkedBuffer.writeTo(out, buffer);
        
        return output.size;
    }
670114
def serialize_message(message):
        
        try:
            return bson.dumps(message.serialize())
        except bson.UnknownSerializerError:
            raise SerializationError(
                "Unable to serialize message: {}.".format(message)
            )
1327193
public static <T> void mergeFrom(byte[] data, T message, Schema<T> schema)
    {
        IOUtil.mergeFrom(data, 0, data.length, message, schema, true);
    }
335078
@SuppressWarnings("unchecked")
    public void writeTo(final Output output, final Object value) throws IOException
    {
        final Schema<Object> schema = strategy.writePojoIdTo(
                output, ID_POJO, (Class<Object>)value.getClass());
        
        if(output instanceof StatefulOutput)
        {
            // update using the derived schema.
            ((StatefulOutput)output).updateLast(schema, this);
        }
        
        // write the rest of the fields of the exact type
        schema.writeTo(output, value);
    }
244158
public static <T> void mergeFrom(byte[] data, int offset, int length, T message, Schema<T> schema, boolean numeric)
            throws IOException
    {

        ArrayBufferInput bios = new ArrayBufferInput(data, offset, length);

        MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(bios);

        try
        {
            mergeFrom(unpacker, message, schema, numeric);
        }
        finally
        {
            unpacker.close();
        }
    }
613099
public static <T> void mergeFrom(Reader r, T message, Schema<T> schema,
            XMLInputFactory inFactory) throws IOException
    {
        XMLStreamReader parser = null;
        try
        {
            parser = inFactory.createXMLStreamReader(r);
            mergeFrom(parser, message, schema);
        }
        catch (XMLStreamException e)
        {
            throw new XmlInputException(e);
        }
        finally
        {
            if (parser != null)
            {
                try
                {
                    parser.close();
                }
                catch (XMLStreamException e)
                {
                    // ignore
                }
            }
        }
    }
1034284
public static byte[] serialize( AbstractMessage message , int typicalSize )
    {
        RawDataBuffer rawMsg = message.getRawMessage();
        if (rawMsg != null)
            return rawMsg.toByteArray();

        RawDataBuffer buffer = new RawDataBuffer(typicalSize);
        buffer.writeByte(message.getType());
        message.serializeTo(buffer);
        
        return buffer.toByteArray();
    }
1205311
@Override
    public void xmlWriteOn(FormattedWriter writer) throws IOException
    {
        // Restore an un-cached message to we can dump its state
        if (msg == null)
            getJSMessage(true);

        try
        {
            if (msg != null)
            {
                writer.newLine();
                writer.taggedValue("JsMessage", msg.getClass().getName());
                writer.newLine();
                writer.taggedValue("systemMessageId", msg.getSystemMessageId());

                if (msg instanceof JsApiMessage)
                {
                    writer.newLine();
                    writer.taggedValue("APIMessageId", ((JsApiMessage) msg).getApiMessageId());
                    writer.newLine();
                    writer.taggedValue("APICorrelId", ((JsApiMessage) msg).getCorrelationId());
                }
                else
                {
                    if (msg.getApiMessageIdAsBytes() != null)
                    {
                        writer.newLine();
                        writer.taggedValue("APIMessageId", new String(msg.getApiMessageIdAsBytes()));
                    }
                    if (msg.getCorrelationIdAsBytes() != null)
                    {
                        writer.newLine();
                        writer.taggedValue("APICorrelId", new String(msg.getCorrelationIdAsBytes()));
                    }
                }

                writer.newLine();
                writer.taggedValue("putTime", new Date(msg.getTimestamp()));

                // If this MessageItem is sitting on an xmit ItemStream then we're probably
                // going to be interested in the GD data in the message.
                try
                {
                    ItemStream is = getItemStream();
                    if (is instanceof PtoPXmitMsgsItemStream)
                    {
                        writer.newLine();
                        writer.startTag("xmitData");
                        writer.indent();

                        writer.newLine();
                        writer.taggedValue("startTick", msg.getGuaranteedValueStartTick());
                        writer.newLine();
                        writer.taggedValue("endTick", msg.getGuaranteedValueEndTick());
                        writer.newLine();
                        writer.taggedValue("priority", msg.getPriority());
                        writer.newLine();
                        writer.taggedValue("reliability", msg.getReliability());
                        writer.newLine();
                        writer.taggedValue("streamId", msg.getGuaranteedStreamUUID());
                        if (msg.getRoutingDestination() != null)
                        {
                            writer.newLine();
                            writer.taggedValue("routingDestination", msg.getRoutingDestination());
                        }

                        writer.outdent();
                        writer.newLine();
                        writer.endTag("xmitData");
                    }
                } catch (SevereMessageStoreException se)
                {
                    // No FFDC code needed
                } catch (RuntimeException re)
                {
                    // No FFDC code needed
                }

                String text = null;
                //if we can easily get the text of the message then use that
                if (msg instanceof JsJmsTextMessage)
                {
                    try
                    {
                        text = ((JsJmsTextMessage) msg).getText();
                        if (text != null && text.length() > 40)
                            text = text.substring(0, 37) + "...";
                    } catch (UnsupportedEncodingException e)
                    {
                        // No FFDC code needed
                        text = "Unsupported message encoding";
                    }
                }
                else
                    text = String.valueOf(msg);

                writer.newLine();
                writer.taggedValue("data", text);
            }
        } catch (RuntimeException e)
        {
            // No FFDC code needed

            // As we're not locking the state down there's very slim chance of hitting
            // something like a NPE while we do this, we'll just catch it and ignore it
        }
    }