/// <summary> /// Method called when input comes as a /// <see cref="System.IO.StreamReader"/> /// , and buffer allocation /// can be done using default mechanism. /// </summary> public ReaderBasedJsonParser(com.fasterxml.jackson.core.io.IOContext ctxt, int features , System.IO.StreamReader r, com.fasterxml.jackson.core.ObjectCodec codec, com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer st) : base(ctxt, features) { _reader = r; _inputBuffer = ctxt.allocTokenBuffer(); _inputPtr = 0; _inputEnd = 0; _objectCodec = codec; _symbols = st; _hashSeed = st.hashSeed(); _bufferRecyclable = true; }
/// <summary> /// Method called when caller wants to provide input buffer directly, /// and it may or may not be recyclable use standard recycle context. /// </summary> /// <since>2.4</since> public ReaderBasedJsonParser(com.fasterxml.jackson.core.io.IOContext ctxt, int features , System.IO.StreamReader r, com.fasterxml.jackson.core.ObjectCodec codec, com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer st, char[] inputBuffer, int start, int end, bool bufferRecyclable) : base(ctxt, features) { // final in 2.3, earlier // Latin1 encoding is not supported, but we do use 8-bit subset for // pre-processing task, to simplify first pass, keep it fast. /* /********************************************************** /* Input configuration /********************************************************** */ /* /********************************************************** /* Configuration /********************************************************** */ /* /********************************************************** /* Parsing state /********************************************************** */ /* /********************************************************** /* Life-cycle /********************************************************** */ _reader = r; _inputBuffer = inputBuffer; _inputPtr = start; _inputEnd = end; _objectCodec = codec; _symbols = st; _hashSeed = st.hashSeed(); _bufferRecyclable = bufferRecyclable; }
/// <summary>Internal constructor used when creating child instances.</summary> private CharsToNameCanonicalizer(com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer parent, int flags, string[] symbols, com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer.Bucket [] buckets, int size, int hashSeed, int longestColl) { _parent = parent; _flags = flags; _canonicalize = com.fasterxml.jackson.core.JsonFactory.Feature.CANONICALIZE_FIELD_NAMES .enabledIn(flags); _symbols = symbols; _buckets = buckets; _size = size; _hashSeed = hashSeed; // Hard-coded fill factor, 75% int arrayLen = (symbols.Length); _sizeThreshold = _thresholdSize(arrayLen); _indexMask = (arrayLen - 1); _longestCollisionList = longestColl; // Need to make copies of arrays, if/when adding new entries _dirty = false; }