/** * Creates a json pipe from a byte array. */ public static Pipe newPipe(byte[] data, boolean numeric) throws IOException { return newPipe(data, 0, data.length, numeric); }
/** * Creates a json pipe from a {@link Reader}. */ public static Pipe newPipe(Reader reader, boolean numeric) throws IOException { return newPipe(DEFAULT_JSON_FACTORY.createJsonParser(reader), numeric); }
/** * 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); }
/** * Creates a smile 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_SMILE_FACTORY._getBufferRecycler(), data, false); final SmileParser parser = newSmileParser(null, data, offset, offset+length, false, context); return JsonIOUtil.newPipe(parser, numeric); //return JsonIOUtil.newPipe(DEFAULT_SMILE_FACTORY.createJsonParser(data, offset, length), numeric); }
/** * 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); }
/** * Creates a smile pipe from an {@link InputStream}. */ 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); }