本文整理汇总了Java中com.fasterxml.jackson.core.Base64Variant类的典型用法代码示例。如果您正苦于以下问题:Java Base64Variant类的具体用法?Java Base64Variant怎么用?Java Base64Variant使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Base64Variant类属于com.fasterxml.jackson.core包,在下文中一共展示了Base64Variant类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBinaryValue
import com.fasterxml.jackson.core.Base64Variant; //导入依赖的package包/类
public byte[] getBinaryValue(Base64Variant paramBase64Variant)
{
JsonNode localJsonNode = currentNode();
if (localJsonNode != null)
{
byte[] arrayOfByte = localJsonNode.binaryValue();
if (arrayOfByte != null)
return arrayOfByte;
if (localJsonNode.isPojo())
{
Object localObject = ((POJONode)localJsonNode).getPojo();
if ((localObject instanceof byte[]))
return (byte[])localObject;
}
}
return null;
}
示例2: _reportInvalidBase64
import com.fasterxml.jackson.core.Base64Variant; //导入依赖的package包/类
@Deprecated
protected void _reportInvalidBase64(Base64Variant paramBase64Variant, char paramChar, int paramInt, String paramString)
{
String str;
if (paramChar <= ' ')
str = "Illegal white space character (code 0x" + Integer.toHexString(paramChar) + ") as character #" + (paramInt + 1) + " of 4-char base64 unit: can only used between units";
else if (paramBase64Variant.usesPaddingChar(paramChar))
str = "Unexpected padding character ('" + paramBase64Variant.getPaddingChar() + "') as character #" + (paramInt + 1) + " of 4-char base64 unit: padding only legal as 3rd or 4th character";
else if ((!Character.isDefined(paramChar)) || (Character.isISOControl(paramChar)))
str = "Illegal character (code 0x" + Integer.toHexString(paramChar) + ") in base64 content";
else
str = "Illegal character '" + paramChar + "' (code 0x" + Integer.toHexString(paramChar) + ") in base64 content";
if (paramString != null)
str = str + ": " + paramString;
throw _constructError(str);
}
示例3: getBinaryValue
import com.fasterxml.jackson.core.Base64Variant; //导入依赖的package包/类
public final byte[] getBinaryValue(Base64Variant paramBase64Variant)
{
if ((this._currToken != JsonToken.VALUE_STRING) && ((this._currToken != JsonToken.VALUE_EMBEDDED_OBJECT) || (this._binaryValue == null)))
_reportError("Current token (" + this._currToken + ") not VALUE_STRING or VALUE_EMBEDDED_OBJECT, can not access as binary");
if (this._tokenIncomplete)
{
try
{
this._binaryValue = _decodeBase64(paramBase64Variant);
}
catch (IllegalArgumentException localIllegalArgumentException)
{
throw _constructError("Failed to decode VALUE_STRING as base64 (" + paramBase64Variant + "): " + localIllegalArgumentException.getMessage());
}
this._tokenIncomplete = false;
}
else if (this._binaryValue == null)
{
ByteArrayBuilder localByteArrayBuilder = _getByteArrayBuilder();
_decodeBase64(getText(), localByteArrayBuilder, paramBase64Variant);
this._binaryValue = localByteArrayBuilder.toByteArray();
}
return this._binaryValue;
}
示例4: readBinaryValue
import com.fasterxml.jackson.core.Base64Variant; //导入依赖的package包/类
public final int readBinaryValue(Base64Variant paramBase64Variant, OutputStream paramOutputStream)
{
if ((!this._tokenIncomplete) || (this._currToken != JsonToken.VALUE_STRING))
{
byte[] arrayOfByte1 = getBinaryValue(paramBase64Variant);
paramOutputStream.write(arrayOfByte1);
return arrayOfByte1.length;
}
byte[] arrayOfByte2 = this._ioContext.allocBase64Buffer();
try
{
int i = _readBinary(paramBase64Variant, paramOutputStream, arrayOfByte2);
return i;
}
finally
{
this._ioContext.releaseBase64Buffer(arrayOfByte2);
}
}
示例5: writeBinary
import com.fasterxml.jackson.core.Base64Variant; //导入依赖的package包/类
public final void writeBinary(Base64Variant paramBase64Variant, byte[] paramArrayOfByte, int paramInt1, int paramInt2)
{
_verifyValueWrite("write binary value");
if (this._outputTail >= this._outputEnd)
_flushBuffer();
char[] arrayOfChar1 = this._outputBuffer;
int i = this._outputTail;
this._outputTail = (i + 1);
arrayOfChar1[i] = '"';
_writeBinary(paramBase64Variant, paramArrayOfByte, paramInt1, paramInt1 + paramInt2);
if (this._outputTail >= this._outputEnd)
_flushBuffer();
char[] arrayOfChar2 = this._outputBuffer;
int j = this._outputTail;
this._outputTail = (j + 1);
arrayOfChar2[j] = '"';
}
示例6: writeBinary
import com.fasterxml.jackson.core.Base64Variant; //导入依赖的package包/类
public void writeBinary(Base64Variant paramBase64Variant, byte[] paramArrayOfByte, int paramInt1, int paramInt2)
{
_verifyValueWrite("write binary value");
if (this._outputTail >= this._outputEnd)
_flushBuffer();
byte[] arrayOfByte1 = this._outputBuffer;
int i = this._outputTail;
this._outputTail = (i + 1);
arrayOfByte1[i] = 34;
_writeBinary(paramBase64Variant, paramArrayOfByte, paramInt1, paramInt1 + paramInt2);
if (this._outputTail >= this._outputEnd)
_flushBuffer();
byte[] arrayOfByte2 = this._outputBuffer;
int j = this._outputTail;
this._outputTail = (j + 1);
arrayOfByte2[j] = 34;
}
示例7: BaseSettings
import com.fasterxml.jackson.core.Base64Variant; //导入依赖的package包/类
public BaseSettings(ClassIntrospector ci, AnnotationIntrospector ai,
VisibilityChecker<?> vc, PropertyNamingStrategy pns, TypeFactory tf,
TypeResolverBuilder<?> typer, DateFormat dateFormat, HandlerInstantiator hi,
Locale locale, TimeZone tz, Base64Variant defaultBase64)
{
_classIntrospector = ci;
_annotationIntrospector = ai;
_visibilityChecker = vc;
_propertyNamingStrategy = pns;
_typeFactory = tf;
_typeResolverBuilder = typer;
_dateFormat = dateFormat;
_handlerInstantiator = hi;
_locale = locale;
_timeZone = tz;
_defaultBase64 = defaultBase64;
}
示例8: testBase64Variant
import com.fasterxml.jackson.core.Base64Variant; //导入依赖的package包/类
public void testBase64Variant() throws Exception
{
Base64Variant orig = Base64Variants.PEM;
byte[] stuff = jdkSerialize(orig);
Base64Variant back = jdkDeserialize(stuff);
assertSame(orig, back);
}
示例9: writeBinary
import com.fasterxml.jackson.core.Base64Variant; //导入依赖的package包/类
@Override
public void writeBinary(final Base64Variant bv, final byte[] data, final int offset, final int len)
throws IOException {
try {
builder.add(attribute, data);
attribute = null;
} catch (final VPackBuilderException e) {
throw new IOException(e);
}
}
示例10: writeBinary
import com.fasterxml.jackson.core.Base64Variant; //导入依赖的package包/类
@Override
public void writeBinary(Base64Variant b64variant, byte[] data, int offset, int len) throws IOException {
if (offset == 0 && len == data.length) {
writeString(b64variant.encode(data));
} else {
byte[] range = Arrays.copyOfRange(data, offset, offset + len);
writeString(b64variant.encode(range));
}
}
示例11: writeBinary
import com.fasterxml.jackson.core.Base64Variant; //导入依赖的package包/类
@Override
public void writeBinary(Base64Variant bv,
byte[] data, int offset, int len) throws IOException {
ByteBuffer buff = ByteBuffer.wrap(data, offset, len);
if (inMap()) {
b.put(currFieldName, buff);
} else {
b.add(buff);
}
}
示例12: getBinaryValue
import com.fasterxml.jackson.core.Base64Variant; //导入依赖的package包/类
@Override
public byte[] getBinaryValue(Base64Variant bv) throws IOException {
ByteBuffer buf = r.getBinary();
byte[] result = new byte[buf.remaining()];
buf.get(result);
return result;
}
示例13: getBinaryValue
import com.fasterxml.jackson.core.Base64Variant; //导入依赖的package包/类
@Override
public byte[] getBinaryValue(Base64Variant b64variant) throws IOException, JsonParseException {
if (currentToken != null) {
String text = currentToken.getText();
return Base64.getDecoder().decode(text); // PENDING: howto deal with the variant?
} else {
return p.getBinaryValue(b64variant);
}
}
示例14: BaseSettings
import com.fasterxml.jackson.core.Base64Variant; //导入依赖的package包/类
public BaseSettings(ClassIntrospector paramClassIntrospector, AnnotationIntrospector paramAnnotationIntrospector, VisibilityChecker<?> paramVisibilityChecker, PropertyNamingStrategy paramPropertyNamingStrategy, TypeFactory paramTypeFactory, TypeResolverBuilder<?> paramTypeResolverBuilder, DateFormat paramDateFormat, HandlerInstantiator paramHandlerInstantiator, Locale paramLocale, TimeZone paramTimeZone, Base64Variant paramBase64Variant)
{
this._classIntrospector = paramClassIntrospector;
this._annotationIntrospector = paramAnnotationIntrospector;
this._visibilityChecker = paramVisibilityChecker;
this._propertyNamingStrategy = paramPropertyNamingStrategy;
this._typeFactory = paramTypeFactory;
this._typeResolverBuilder = paramTypeResolverBuilder;
this._dateFormat = paramDateFormat;
this._handlerInstantiator = paramHandlerInstantiator;
this._locale = paramLocale;
this._timeZone = paramTimeZone;
this._defaultBase64 = paramBase64Variant;
}
示例15: with
import com.fasterxml.jackson.core.Base64Variant; //导入依赖的package包/类
public final BaseSettings with(TimeZone paramTimeZone)
{
if (paramTimeZone == null)
throw new IllegalArgumentException();
DateFormat localDateFormat1 = this._dateFormat;
Object localObject;
if ((localDateFormat1 instanceof StdDateFormat))
{
localObject = ((StdDateFormat)localDateFormat1).withTimeZone(paramTimeZone);
}
else
{
DateFormat localDateFormat2 = (DateFormat)localDateFormat1.clone();
localObject = localDateFormat2;
localDateFormat2.setTimeZone(paramTimeZone);
}
ClassIntrospector localClassIntrospector = this._classIntrospector;
AnnotationIntrospector localAnnotationIntrospector = this._annotationIntrospector;
VisibilityChecker localVisibilityChecker = this._visibilityChecker;
PropertyNamingStrategy localPropertyNamingStrategy = this._propertyNamingStrategy;
TypeFactory localTypeFactory = this._typeFactory;
TypeResolverBuilder localTypeResolverBuilder = this._typeResolverBuilder;
HandlerInstantiator localHandlerInstantiator = this._handlerInstantiator;
Locale localLocale = this._locale;
Base64Variant localBase64Variant = this._defaultBase64;
return new BaseSettings(localClassIntrospector, localAnnotationIntrospector, localVisibilityChecker, localPropertyNamingStrategy, localTypeFactory, localTypeResolverBuilder, (DateFormat)localObject, localHandlerInstantiator, localLocale, paramTimeZone, localBase64Variant);
}