@Override public JsonParser createParser(ObjectReadContext readCtxt, URL url) throws IOException { // true, since we create InputStream from URL IOContext ioCtxt = _createContext(url, true); InputStream in = _optimizedStreamFromURL(url); return _createParser(readCtxt, ioCtxt, _decorate(ioCtxt, in)); }
@Override public JsonGenerator createGenerator(ObjectWriteContext writeCtxt, OutputStream out, JsonEncoding enc) throws IOException { // false -> we won't manage the stream unless explicitly directed to IOContext ioCtxt = _createContext(out, false, enc); return _createGenerator(writeCtxt, ioCtxt, _decorate(ioCtxt, out)); }
@Override public JsonParser createParser(ObjectReadContext readCtxt, char[] content, int offset, int len) throws IOException { return _nonByteSource(); }
@Override public JsonParser createParser(ObjectReadContext readCtxt, InputStream in) throws IOException { IOContext ioCtxt = _createContext(in, false); return _createParser(readCtxt, ioCtxt, _decorate(ioCtxt, in)); }
@Override public JsonParser createParser(ObjectReadContext readCtxt, byte[] data, int offset, int len) throws IOException { IOContext ioCtxt = _createContext(data, true, null); if (_inputDecorator != null) { InputStream in = _inputDecorator.decorate(ioCtxt, data, offset, len); if (in != null) { return _createParser(readCtxt, ioCtxt, in); } } return _createParser(readCtxt, ioCtxt, data, offset, len); }
@Override protected IOContext _createContext(Object srcRef, boolean resourceManaged) { return super._createContext(srcRef, resourceManaged); }
@Override public JsonGenerator createGenerator(ObjectWriteContext writeCtxt, Writer w) throws IOException { return _nonByteTarget(); }
@Override public JsonParser createParser(ObjectReadContext readCtxt, DataInput in) throws IOException { IOContext ioCtxt = _createContext(in, false); return _createParser(readCtxt, ioCtxt, _decorate(ioCtxt, in)); }
@Override public JsonParser createParser(ObjectReadContext readCtxt, File f) throws IOException { // true, since we create InputStream from File IOContext ioCtxt = _createContext(f, true); InputStream in = new FileInputStream(f); return _createParser(readCtxt, ioCtxt, _decorate(ioCtxt, in)); }
@Override public JsonGenerator createGenerator(ObjectWriteContext writeCtxt, File f, JsonEncoding enc) throws IOException { OutputStream out = new FileOutputStream(f); // true -> yes, we have to manage the stream since we created it IOContext ioCtxt = _createContext(out, true, enc); return _createGenerator(writeCtxt, ioCtxt, _decorate(ioCtxt, out)); }
@Override public JsonParser createParser(ObjectReadContext readCtxt, String content) throws IOException { return _nonByteSource(); }
@Override public JsonParser createParser(ObjectReadContext readCtxt, Reader r) throws IOException { return _nonByteSource(); }