/** * Encodes a byte array into Base64 notation. Does not GZip-compress data. * * @param source The data to convert * @param off Offset in array where conversion should begin * @param len Length of data to convert * @return encoded byte array * @since 1.4 */ public static String encodeBytes(byte[] source, int off, int len) { return encodeBytes(source, off, len, NO_OPTIONS); } // end encodeBytes
/** * Encodes a byte array into Base64 notation. Does not GZip-compress data. * * @param source The data to convert * @return encoded byte array * @since 1.4 */ public static String encodeBytes(byte[] source) { return encodeBytes(source, 0, source.length, NO_OPTIONS); } // end encodeBytes
/** * Encodes a byte array into Base64 notation. Does not GZip-compress data. * * @param source The data to convert * @return encoded byte array * @since 1.4 */ public static String encodeBytes(byte[] source) { return encodeBytes(source, 0, source.length, NO_OPTIONS); } // end encodeBytes
/** * Encodes a byte array into Base64 notation. Does not GZip-compress data. * * @param source The data to convert * @param off Offset in array where conversion should begin * @param len Length of data to convert * @return encoded byte array * @since 1.4 */ public static String encodeBytes(byte[] source, int off, int len) { return encodeBytes(source, off, len, NO_OPTIONS); } // end encodeBytes
/** * Encodes a byte array into Base64 notation. Does not GZip-compress data. * * @param source The data to convert * @return encoded byte array * @since 1.4 */ public static String encodeBytes(byte[] source) { return encodeBytes(source, 0, source.length, NO_OPTIONS); } // end encodeBytes
/** * Encodes a byte array into Base64 notation. Does not GZip-compress data. * * @param source The data to convert * @param off Offset in array where conversion should begin * @param len Length of data to convert * @return encoded byte array * @since 1.4 */ public static String encodeBytes(byte[] source, int off, int len) { return encodeBytes(source, off, len, NO_OPTIONS); } // end encodeBytes
public static void setStartKey(Configuration conf, byte[] startKey) { conf.set(START_BASE64, Base64.encodeBytes(startKey)); }
@VisibleForTesting static void setChar(Configuration conf, String confKey, char charValue) { conf.set(confKey, Base64.encodeBytes(Character.toString(charValue).getBytes())); }
static String convertScanToString(Scan scan) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(out); scan.write(dos); return Base64.encodeBytes(out.toByteArray()); }
static String convertScanToString(Scan scan) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(out); scan.write(dos); return Base64.encodeBytes(out.toByteArray()); }
public static void setIndexMaintainers(final Configuration configuration, final ImmutableBytesWritable indexMetaDataPtr) { Preconditions.checkNotNull(configuration); Preconditions.checkNotNull(indexMetaDataPtr); configuration.set(INDEX_MAINTAINERS, Base64.encodeBytes(indexMetaDataPtr.get())); }
/** * Writes the given scan into a Base64 encoded string. * * @param scan The scan to write out. * @return The scan saved in a Base64 encoded string. * @throws IOException When writing the scan fails. */ static String convertScanToString(Scan scan) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(out); scan.write(dos); return Base64.encodeBytes(out.toByteArray()); }
/** * Writes the given updatesProcessor into a Base64 encoded string. * * @param up The updatesProcessor to write out. * @return The updateProcessor saved in a Base64 encoded string. * @throws java.io.IOException When writing the updateProcessor fails. */ static String convertUpdateProcessorToString(UpdateProcessor up) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(out); up.write(dos); return Base64.encodeBytes(out.toByteArray()); }
/** * Converts an array of Scan objects into a base64 string * @param scans * @return * @throws IOException */ public static String convertScanArrayToString(final Scan[] scans) throws IOException { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final DataOutputStream dos = new DataOutputStream(baos); ArrayWritable aw = new ArrayWritable(Scan.class, scans); aw.write(dos); return Base64.encodeBytes(baos.toByteArray()); }
/** * Writes the given scan into a Base64 encoded string. * * @param scan The scan to write out. * @return The scan saved in a Base64 encoded string. * @throws IOException When writing the scan fails. */ public static String convertScanToString(Scan scan) throws IOException { ClientProtos.Scan proto = ProtobufUtil.toScan(scan); return Base64.encodeBytes(proto.toByteArray()); }
/** * Writes the given scan into a Base64 encoded string. * * @param scan The scan to write out. * @return The scan saved in a Base64 encoded string. * @throws IOException When writing the scan fails. */ static String convertScanToString(Scan scan) throws IOException { ClientProtos.Scan proto = ProtobufUtil.toScan(scan); return Base64.encodeBytes(proto.toByteArray()); } }
/** * Writes the given scan into a Base64 encoded string. * * @param scan The scan to write out. * @return The scan saved in a Base64 encoded string. * @throws IOException When writing the scan fails. */ static String convertScanToString(Scan scan) throws IOException { ClientProtos.Scan proto = ProtobufUtil.toScan(scan); return Base64.encodeBytes(proto.toByteArray()); }
static String convertScanToString(Scan scan) throws IOException { ClientProtos.Scan proto = ProtobufUtil.toScan(scan); return Base64.encodeBytes(proto.toByteArray()); }
/** * Writes the given scan into a Base64 encoded string. * * @param scan * The scan to write out. * @return The scan saved in a Base64 encoded string. * @throws IOException * When writing the scan fails. */ static String convertScanToString(Scan scan) throws IOException { ClientProtos.Scan proto = ProtobufUtil.toScan(scan); return Base64.encodeBytes(proto.toByteArray()); }
/** * COPIED from {@link TableMapReduceUtil} since it's not visible in that class. * Makes this class somewhat brittle, but if we call the static method directly we * risk overwriting the mapper class. * * @param scan the scan to convert * @return string-representation of the scan * @throws IOException if encoding to base64 bytes fails */ protected String convertScanToString(Scan scan) throws IOException { ClientProtos.Scan proto = ProtobufUtil.toScan(scan); return Base64.encodeBytes(proto.toByteArray()); } }