/** * Convenience method for converting given byte array as base64 encoded * String using this variant's settings. * Resulting value is "raw", that is, not enclosed in double-quotes. * * @param input Byte array to encode */ public String encode(byte[] input) { return encode(input, false); }
/** * Convenience method for converting given byte array as base64 encoded * String using this variant's settings. * Resulting value is "raw", that is, not enclosed in double-quotes. * * @param input Byte array to encode */ public String encode(byte[] input) { return encode(input, false); }
/** * Hmmh. This is not quite as efficient as using {@link #serialize}, * but will work correctly. */ @Override public String asText() { return Base64Variants.getDefaultVariant().encode(_data, false); }
/** * Different from other values, since contents need to be surrounded * by (double) quotes. */ @Override public String toString() { return Base64Variants.getDefaultVariant().encode(_data, true); } }
public LibratoWriterFactory( @JsonProperty("typeNames") ImmutableList<String> typeNames, @JsonProperty("booleanAsNumber") boolean booleanAsNumber, @JsonProperty("url") URL url, @JsonProperty("libratoApiTimeoutInMillis") Integer readTimeoutInMillis, @JsonProperty("username") String username, @JsonProperty("token") String token, @JsonProperty("proxyHost") String proxyHost, @JsonProperty("proxyPort") Integer proxyPort) { this.booleanAsNumber = booleanAsNumber; this.typeNames = firstNonNull(typeNames, ImmutableList.<String>of()); this.url = checkNotNull(url); this.readTimeoutInMillis = firstNonNull(readTimeoutInMillis, 1000); this.authorization = "Basic" + Base64Variants .getDefaultVariant() .encode( (checkNotNull(username) + ":" + checkNotNull(token)).getBytes(US_ASCII) ); proxy = initProxy(proxyHost, proxyPort); }
private void _writeScalarBinary(Base64Variant b64variant, byte[] data) throws IOException { // 15-Dec-2017, tatu: as per [dataformats-text#62], can not use SnakeYAML's internal // codec. Also: force use of linefeed variant if using default if (b64variant == Base64Variants.getDefaultVariant()) { b64variant = Base64Variants.MIME; } String encoded = b64variant.encode(data); _emitter.emit(new ScalarEvent(null, TAG_BINARY, EXPLICIT_TAGS, encoded, null, null, STYLE_BASE64)); }
case TYPE_BYTE_ARRAY: String encoded = provider.getConfig().getBase64Variant().encode((byte[]) value); g.writeFieldName(encoded);
this.basicAuthentication = Base64Variants .getDefaultVariant() .encode((this.username + ":" + this.token).getBytes(Charsets.US_ASCII)); this.proxyHost = proxyHost != null ? proxyHost : (String) getSettings().get(SETTING_PROXY_HOST); this.proxyPort = proxyPort != null ? proxyPort : Settings.getIntegerSetting(getSettings(), SETTING_PROXY_PORT, null);
return ctxt.getBase64Variant().encode((byte[]) ob, false);
return Base64Variants.getDefaultVariant().encode((byte[]) ob, false).toCharArray();
private void _writeScalarBinary(Base64Variant b64variant, byte[] data) throws IOException { // 15-Dec-2017, tatu: as per [dataformats-text#62], can not use SnakeYAML's internal // codec. Also: force use of linefeed variant if using default if (b64variant == Base64Variants.getDefaultVariant()) { b64variant = Base64Variants.MIME; } String encoded = b64variant.encode(data); _emitter.emit(new ScalarEvent(null, TAG_BINARY, EXPLICIT_TAGS, encoded, null, null, STYLE_BASE64)); }
/** * Convenience method for converting given byte array as base64 encoded * String using this variant's settings. * Resulting value is "raw", that is, not enclosed in double-quotes. * * @param input Byte array to encode */ public String encode(byte[] input) { return encode(input, false); }
/** * Convenience method for converting given byte array as base64 encoded * String using this variant's settings. * Resulting value is "raw", that is, not enclosed in double-quotes. * * @param input Byte array to encode */ public String encode(byte[] input) { return encode(input, false); }
/** * Hmmh. This is not quite as efficient as using {@link #serialize}, * but will work correctly. */ @Override public String asText() { return Base64Variants.getDefaultVariant().encode(_data, false); }
/** * Different from other values, since contents need to be surrounded * by (double) quotes. */ @Override public String toString() { return Base64Variants.getDefaultVariant().encode(_data, true); } }
/** * Different from other values, since contents need to be surrounded * by (double) quotes. */ @Override public String toString() { return Base64Variants.getDefaultVariant().encode(_data, true); } }
/** * Hmmh. This is not quite as efficient as using {@link #serialize}, * but will work correctly. */ @Override public String asText() { return Base64Variants.getDefaultVariant().encode(_data, false); }
/** * Different from other values, since contents need to be surrounded * by (double) quotes. */ @Override public String toString() { return Base64Variants.getDefaultVariant().encode(_data, true); } }
/** * Hmmh. This is not quite as efficient as using {@link #serialize}, * but will work correctly. */ @Override public String asText() { return Base64Variants.getDefaultVariant().encode(_data, false); }
private void _writeScalarBinaryPatched(Base64Variant b64variant, byte[] data) throws IOException { String encoded = b64variant.encode(data); _emitter.emit(new ScalarEvent(null, TAG_BINARY, EXPLICIT_TAGS, encoded, null, null, STYLE_BASE64)); }