Package org.codehaus.jackson.io

Examples of org.codehaus.jackson.io.IOContext


     * using the given {@code schema}.
     */
    public static <T> void writeTo(OutputStream out, T message, Schema<T> schema,
            boolean numeric) throws IOException
    {
        final IOContext context = new IOContext(DEFAULT_SMILE_FACTORY._getBufferRecycler(),
                out, false);
       
        final SmileGenerator generator = newSmileGenerator(out,
                context.allocWriteEncodingBuffer(), 0, true, context);
       
        //final SmileGenerator generator = DEFAULT_SMILE_FACTORY.createJsonGenerator(out);
       
        try
        {
View Full Code Here


     * when writing the message.
     */
    public static <T> void writeTo(OutputStream out, T message, Schema<T> schema,
            boolean numeric, LinkedBuffer buffer) throws IOException
    {
        final IOContext context = new IOContext(DEFAULT_SMILE_FACTORY._getBufferRecycler(),
                out, false);
       
        final SmileGenerator generator = newSmileGenerator(out, buffer.buffer, 0, false,
                context);
       
View Full Code Here

     * Serializes the {@code messages} into the stream using the given schema.
     */
    public static <T> void writeListTo(OutputStream out, List<T> messages,
            Schema<T> schema, boolean numeric) throws IOException
    {
        final IOContext context = new IOContext(DEFAULT_SMILE_FACTORY._getBufferRecycler(),
                out, false);
       
        final SmileGenerator generator = newSmileGenerator(out,
                context.allocWriteEncodingBuffer(), 0, true, context);
       
        //final SmileGenerator generator = DEFAULT_SMILE_FACTORY.createJsonGenerator(out);
        try
        {
            JsonIOUtil.writeListTo(generator, messages, schema, numeric);
View Full Code Here

     * when writing the message.
     */
    public static <T> void writeListTo(OutputStream out, List<T> messages,
            Schema<T> schema, boolean numeric, LinkedBuffer buffer) throws IOException
    {
        final IOContext context = new IOContext(DEFAULT_SMILE_FACTORY._getBufferRecycler(),
                out, false);
       
        final SmileGenerator generator = newSmileGenerator(out, buffer.buffer, 0, false,
                context);
       
View Full Code Here

     * Parses the {@code messages} from the stream using the given {@code schema}.
     */
    public static <T> List<T> parseListFrom(InputStream in, Schema<T> schema,
            boolean numeric) throws IOException
    {
        final IOContext context = new IOContext(DEFAULT_SMILE_FACTORY._getBufferRecycler(),
                in, false);
        final SmileParser parser = newSmileParser(in, context.allocReadIOBuffer(), 0, 0,
                true, context);
       
        //final SmileParser parser = DEFAULT_SMILE_FACTORY.createJsonParser(in);
        try
        {
View Full Code Here

     * message.
     */
    public static <T> List<T> parseListFrom(InputStream in, Schema<T> schema,
            boolean numeric, LinkedBuffer buffer) throws IOException
    {
        final IOContext context = new IOContext(DEFAULT_SMILE_FACTORY._getBufferRecycler(),
                in, false);
        final SmileParser parser = newSmileParser(in, buffer.buffer, 0, 0, false, context);
       
        //final SmileParser parser = DEFAULT_SMILE_FACTORY.createJsonParser(in);
        try
View Full Code Here

     * Creates a json pipe from a byte array.
     */
    public static Pipe newPipe(byte[] data, int offset, int length, boolean numeric)
    throws IOException
    {
        final IOContext context = new IOContext(DEFAULT_JSON_FACTORY._getBufferRecycler(),
                data, false);
        final JsonParser parser = newJsonParser(null, data, offset, offset+length, false,
                context);
       
        return newPipe(parser, numeric);
View Full Code Here

    /**
     * Creates a json pipe from an {@link InputStream}.
     */
    public static Pipe newPipe(InputStream in, boolean numeric) throws IOException
    {
        final IOContext context = new IOContext(DEFAULT_JSON_FACTORY._getBufferRecycler(),
                in, false);
        final JsonParser parser = newJsonParser(in, context.allocReadIOBuffer(), 0, 0,
                true, context);
       
        return newPipe(parser, numeric);
    }
View Full Code Here

     */
    public static Utf8StreamParser newJsonParser(InputStream in, byte[] buf,
            int offset, int limit) throws IOException
    {
        return newJsonParser(in, buf, offset, limit, false,
                new IOContext(DEFAULT_JSON_FACTORY._getBufferRecycler(), in,
                        false));
    }
View Full Code Here

     * Creates a {@link Utf8Generator} for the outputstream with the supplied buf
     * {@code outBuffer} to use.
     */
    public static Utf8Generator newJsonGenerator(OutputStream out, byte[] buf)
    {
        return newJsonGenerator(out, buf, 0, false, new IOContext(
                DEFAULT_JSON_FACTORY._getBufferRecycler(), out, false));
    }
View Full Code Here

TOP

Related Classes of org.codehaus.jackson.io.IOContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.