本文整理汇总了Java中com.fasterxml.jackson.core.io.IOContext.allocTokenBuffer方法的典型用法代码示例。如果您正苦于以下问题:Java IOContext.allocTokenBuffer方法的具体用法?Java IOContext.allocTokenBuffer怎么用?Java IOContext.allocTokenBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.fasterxml.jackson.core.io.IOContext
的用法示例。
在下文中一共展示了IOContext.allocTokenBuffer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createParser
import com.fasterxml.jackson.core.io.IOContext; //导入方法依赖的package包/类
@Override
public JsonParser createParser(ObjectReadContext readCtxt,
String content) throws IOException
{
final int strLen = content.length();
// Actually, let's use this for medium-sized content, up to 64kB chunk (32kb char)
if ((_inputDecorator != null) || (strLen > 0x8000) || !canUseCharArrays()) {
// easier to just wrap in a Reader than extend InputDecorator; or, if content
// is too long for us to copy it over
return createParser(readCtxt, new StringReader(content));
}
IOContext ioCtxt = _createContext(content, true);
char[] buf = ioCtxt.allocTokenBuffer(strLen);
content.getChars(0, strLen, buf, 0);
return _createParser(readCtxt, ioCtxt, buf, 0, strLen, true);
}
示例2: ReaderBasedJsonParser
import com.fasterxml.jackson.core.io.IOContext; //导入方法依赖的package包/类
/**
* Method called when input comes as a {@link java.io.Reader}, and buffer allocation
* can be done using default mechanism.
*/
public ReaderBasedJsonParser(ObjectReadContext readCtxt, IOContext ctxt,
int features, Reader r,
CharsToNameCanonicalizer st)
{
super(readCtxt, ctxt, features);
_reader = r;
_inputBuffer = ctxt.allocTokenBuffer();
_inputPtr = 0;
_inputEnd = 0;
_symbols = st;
_hashSeed = st.hashSeed();
_bufferRecyclable = true;
}
示例3: ReaderBasedJsonParser
import com.fasterxml.jackson.core.io.IOContext; //导入方法依赖的package包/类
public ReaderBasedJsonParser(IOContext paramIOContext, int paramInt, Reader paramReader, ObjectCodec paramObjectCodec, CharsToNameCanonicalizer paramCharsToNameCanonicalizer)
{
super(paramIOContext, paramInt);
this._reader = paramReader;
this._inputBuffer = paramIOContext.allocTokenBuffer();
this._objectCodec = paramObjectCodec;
this._symbols = paramCharsToNameCanonicalizer;
this._hashSeed = paramCharsToNameCanonicalizer.hashSeed();
}
示例4: ReaderBasedJsonParser
import com.fasterxml.jackson.core.io.IOContext; //导入方法依赖的package包/类
public ReaderBasedJsonParser(IOContext ctxt, int features, Reader r,
ObjectCodec codec, CharsToNameCanonicalizer st)
{
super(ctxt, features);
_reader = r;
_inputBuffer = ctxt.allocTokenBuffer();
_objectCodec = codec;
_symbols = st;
_hashSeed = st.hashSeed();
}