@Override public byte[] getBinaryValue(Base64Variant b64variant) throws IOException, JsonParseException { return delegate.getBinaryValue(b64variant); }
protected Byte[] deserializeFromBase64(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { // First same as what PrimitiveArrayDeserializers.ByteDeser does: byte[] b = jp.getBinaryValue(ctxt.getBase64Variant()); // But then need to convert to wrappers Byte[] result = new Byte[b.length]; for (int i = 0, len = b.length; i < len; ++i) { result[i] = Byte.valueOf(b[i]); } return result; }
/** * Convenience alternative to {@link #getBinaryValue(Base64Variant)} * that defaults to using * {@link Base64Variants#getDefaultVariant} as the default encoding. */ public byte[] getBinaryValue() throws IOException, JsonParseException { return getBinaryValue(Base64Variants.getDefaultVariant()); }
@Override public byte[] binaryValue() { try { return parser.getBinaryValue(); } catch (IOException ex) { throw new EsHadoopSerializationException(ex); } }
@Override public byte[] getBinaryValue(Base64Variant b64variant) throws IOException, JsonParseException { return delegate.getBinaryValue(b64variant); }
@Override public byte[] getBinaryValue(Base64Variant base64Variant) throws IOException, JsonParseException { return parser.getBinaryValue(base64Variant); }
return jp.getBinaryValue(ctxt.getBase64Variant());
/** * Convenience alternative to {@link #getBinaryValue(Base64Variant)} * that defaults to using * {@link Base64Variants#getDefaultVariant} as the default encoding. */ public byte[] getBinaryValue() throws IOException, JsonParseException { return getBinaryValue(Base64Variants.getDefaultVariant()); }
protected Byte[] deserializeFromBase64(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { // First same as what PrimitiveArrayDeserializers.ByteDeser does: byte[] b = jp.getBinaryValue(ctxt.getBase64Variant()); // But then need to convert to wrappers Byte[] result = new Byte[b.length]; for (int i = 0, len = b.length; i < len; ++i) { result[i] = Byte.valueOf(b[i]); } return result; }
@Override public byte[] getBinaryValue(Base64Variant base64Variant) throws IOException, JsonParseException { return parser.getBinaryValue(base64Variant); }
@Override public byte[] getBinaryValue(Base64Variant b64variant) throws IOException, JsonParseException { return delegate.getBinaryValue(b64variant); }
public ByteString readFrom(JsonParser parser) throws IOException { return ByteString.copyFrom(parser.getBinaryValue()); //return ByteString.copyFromUtf8(parser.getText()); } public void writeTo(JsonGenerator generator, ByteString value) throws IOException
return jp.getBinaryValue(ctxt.getBase64Variant());
public byte[] readByteArray() throws IOException { final byte[] value = parser.getBinaryValue(); if(lastRepeated && parser.nextToken()==END_ARRAY) lastRepeated = false; return value; }
@Override public byte[] binaryValue() { try { return parser.getBinaryValue(); } catch (IOException ex) { throw new EsHadoopSerializationException(ex); } }
@Override public byte[] binaryValue() { try { return parser.getBinaryValue(); } catch (IOException ex) { throw new EsHadoopSerializationException(ex); } }
protected Byte[] deserializeFromBase64(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { // First same as what ArrayDeserializers.ByteDeser does: byte[] b = jp.getBinaryValue(ctxt.getBase64Variant()); // But then need to convert to wrappers Byte[] result = new Byte[b.length]; for (int i = 0, len = b.length; i < len; ++i) { result[i] = Byte.valueOf(b[i]); } return result; }
@Override public byte[] binaryValue() { try { return parser.getBinaryValue(); } catch (IOException ex) { throw new EsHadoopSerializationException(ex); } }
protected Byte[] deserializeFromBase64(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { // First same as what PrimitiveArrayDeserializers.ByteDeser does: byte[] b = jp.getBinaryValue(ctxt.getBase64Variant()); // But then need to convert to wrappers Byte[] result = new Byte[b.length]; for (int i = 0, len = b.length; i < len; ++i) { result[i] = Byte.valueOf(b[i]); } return result; }
protected Byte[] deserializeFromBase64(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { // First same as what PrimitiveArrayDeserializers.ByteDeser does: byte[] b = jp.getBinaryValue(ctxt.getBase64Variant()); // But then need to convert to wrappers Byte[] result = new Byte[b.length]; for (int i = 0, len = b.length; i < len; ++i) { result[i] = Byte.valueOf(b[i]); } return result; }