当前位置: 首页>>代码示例>>Java>>正文


Java Base64Variant类代码示例

本文整理汇总了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;
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:18,代码来源:TreeTraversingParser.java

示例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);
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:17,代码来源:ParserMinimalBase.java

示例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;
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:25,代码来源:UTF8StreamJsonParser.java

示例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);
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:20,代码来源:UTF8StreamJsonParser.java

示例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] = '"';
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:18,代码来源:WriterBasedJsonGenerator.java

示例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;
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:18,代码来源:UTF8JsonGenerator.java

示例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;
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:18,代码来源:BaseSettings.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:TestJDKSerializability.java

示例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);
	}
}
 
开发者ID:arangodb,项目名称:jackson-dataformat-velocypack,代码行数:11,代码来源:VPackGenerator.java

示例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));
    }
}
 
开发者ID:jspare-projects,项目名称:vertx-jspare,代码行数:10,代码来源:JsonElementGenerator.java

示例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);
  }
}
 
开发者ID:ojai,项目名称:ojai,代码行数:11,代码来源:DocumentGenerator.java

示例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;
}
 
开发者ID:ojai,项目名称:ojai,代码行数:8,代码来源:DocumentParser.java

示例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);
    }
}
 
开发者ID:cinnober,项目名称:msgcodec,代码行数:10,代码来源:TypeScannerJsonParser.java

示例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;
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:15,代码来源:BaseSettings.java

示例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);
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:28,代码来源:BaseSettings.java


注:本文中的com.fasterxml.jackson.core.Base64Variant类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。