Examples of allocReadIOBuffer()


Examples of com.fasterxml.jackson.core.io.IOContext.allocReadIOBuffer()

    public void testSimple() throws Exception
    {
        BufferRecycler rec = new BufferRecycler();
        IOContext ctxt = new IOContext(rec, null, false);
        // bit complicated; must use recyclable buffer...
        byte[] first = ctxt.allocReadIOBuffer();
        System.arraycopy("ABCDE".getBytes("UTF-8"), 0, first, 99, 5);
        byte[] second = "FGHIJ".getBytes("UTF-8");

        assertNull(ctxt.getSourceReference());
        assertFalse(ctxt.isResourceManaged());
View Full Code Here

Examples of com.fasterxml.jackson.core.io.IOContext.allocReadIOBuffer()

        IOContext ctxt = new IOContext(new BufferRecycler(), "N/A", true);

        /* I/O Read buffer */

        // First succeeds:
        assertNotNull(ctxt.allocReadIOBuffer());
        // second fails
        try {
            ctxt.allocReadIOBuffer();
        } catch (IllegalStateException e) {
            verifyException(e, "second time");
View Full Code Here

Examples of com.fasterxml.jackson.core.io.IOContext.allocReadIOBuffer()

        // First succeeds:
        assertNotNull(ctxt.allocReadIOBuffer());
        // second fails
        try {
            ctxt.allocReadIOBuffer();
        } catch (IllegalStateException e) {
            verifyException(e, "second time");
        }
        // Also: can't succeed with different buffer
        try {
View Full Code Here

Examples of org.codehaus.jackson.io.IOContext.allocReadIOBuffer()

     */
    public static Pipe newPipe(InputStream in, 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);
       
        return JsonIOUtil.newPipe(parser, numeric);
        //return JsonIOUtil.newPipe(DEFAULT_SMILE_FACTORY.createJsonParser(in), numeric);
    }
View Full Code Here

Examples of org.codehaus.jackson.io.IOContext.allocReadIOBuffer()

    public static <T> void mergeFrom(InputStream in, T message, 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

Examples of org.codehaus.jackson.io.IOContext.allocReadIOBuffer()

    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

Examples of org.codehaus.jackson.io.IOContext.allocReadIOBuffer()

     */
    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

Examples of org.codehaus.jackson.io.IOContext.allocReadIOBuffer()

    public static <T> void mergeFrom(InputStream in, T message, Schema<T> schema,
            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);
        //final JsonParser parser = DEFAULT_JSON_FACTORY.createJsonParser(in);
        try
        {
            mergeFrom(parser, message, schema, numeric);
View Full Code Here

Examples of org.codehaus.jackson.io.IOContext.allocReadIOBuffer()

    public static <T> List<T> parseListFrom(InputStream in, Schema<T> schema,
            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);
        //final JsonParser parser = DEFAULT_JSON_FACTORY.createJsonParser(in);
        try
        {
            return parseListFrom(parser, schema, numeric);
View Full Code Here

Examples of org.codehaus.jackson.io.IOContext.allocReadIOBuffer()

            /* This may be unfair advantage (allocating buffer of exact
             * size)? But let's do that for now
             */
            //char[] cbuf = new char[mData.length];
            //InputStreamReader r = new InputStreamReader(bin, "UTF-8");
            byte[] bbuf = ctxt.allocReadIOBuffer();
            /* 13-Jan-2009, tatu: Note: Noggit doesn't use our turbo-charged
             *   UTF8 codec by default. But let's make it as fast as we
             *   possibly can...
             */
            UTF8Reader r = new UTF8Reader(ctxt, bin, bbuf, 0, 0);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.