ByteArrayContainer(byte[] ba) { asUtf8 = new String(ba, StandardCharsets.UTF_8); asBase64 = Base64.encodeBase64URLSafeString(ba); } }
public static String encodeAsBase64FileName(Text data) { String encodedRow = Base64.encodeBase64URLSafeString(TextUtil.getBytes(data)); int index = encodedRow.length() - 1; while (index >= 0 && encodedRow.charAt(index) == '=') index--; encodedRow = encodedRow.substring(0, index + 1); return encodedRow; }