本文整理汇总了Java中com.fasterxml.jackson.core.io.IOContext.allocWriteEncodingBuffer方法的典型用法代码示例。如果您正苦于以下问题:Java IOContext.allocWriteEncodingBuffer方法的具体用法?Java IOContext.allocWriteEncodingBuffer怎么用?Java IOContext.allocWriteEncodingBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.fasterxml.jackson.core.io.IOContext
的用法示例。
在下文中一共展示了IOContext.allocWriteEncodingBuffer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: UTF8JsonGenerator
import com.fasterxml.jackson.core.io.IOContext; //导入方法依赖的package包/类
public UTF8JsonGenerator(ObjectWriteContext writeCtxt, IOContext ioCtxt,
int features, OutputStream out,
SerializableString rootValueSep, CharacterEscapes charEsc, PrettyPrinter pp)
{
super(writeCtxt, ioCtxt, features, rootValueSep, charEsc, pp);
_outputStream = out;
_bufferRecyclable = true;
_outputBuffer = ioCtxt.allocWriteEncodingBuffer();
_outputEnd = _outputBuffer.length;
// To be exact, each char can take up to 6 bytes when escaped (Unicode
// escape with backslash, 'u' and 4 hex digits); but to avoid fluctuation,
// we will actually round down to only do up to 1/8 number of chars
_outputMaxContiguous = _outputEnd >> 3;
_charBuffer = ioCtxt.allocConcatBuffer();
_charBufferLength = _charBuffer.length;
// By default we use this feature to determine additional quoting
if (isEnabled(Feature.ESCAPE_NON_ASCII)) {
setHighestNonEscapedChar(127);
}
}
示例2: UTF8JsonGenerator
import com.fasterxml.jackson.core.io.IOContext; //导入方法依赖的package包/类
public UTF8JsonGenerator(IOContext paramIOContext, int paramInt, ObjectCodec paramObjectCodec, OutputStream paramOutputStream)
{
super(paramIOContext, paramInt, paramObjectCodec);
this._outputStream = paramOutputStream;
this._bufferRecyclable = true;
this._outputBuffer = paramIOContext.allocWriteEncodingBuffer();
this._outputEnd = this._outputBuffer.length;
this._outputMaxContiguous = (this._outputEnd >> 3);
this._charBuffer = paramIOContext.allocConcatBuffer();
this._charBufferLength = this._charBuffer.length;
if (isEnabled(JsonGenerator.Feature.ESCAPE_NON_ASCII))
setHighestNonEscapedChar(127);
}