本文整理汇总了Java中org.apache.hadoop.hbase.util.Base64.encodeBytes方法的典型用法代码示例。如果您正苦于以下问题:Java Base64.encodeBytes方法的具体用法?Java Base64.encodeBytes怎么用?Java Base64.encodeBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.util.Base64
的用法示例。
在下文中一共展示了Base64.encodeBytes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ByteArrayComparableModel
import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
public ByteArrayComparableModel(
ByteArrayComparable comparator) {
String typeName = comparator.getClass().getSimpleName();
ComparatorType type = ComparatorType.valueOf(typeName);
this.type = typeName;
switch (type) {
case BinaryComparator:
case BinaryPrefixComparator:
this.value = Base64.encodeBytes(comparator.getValue());
break;
case BitComparator:
this.value = Base64.encodeBytes(comparator.getValue());
this.op = ((BitComparator)comparator).getOperator().toString();
break;
case NullComparator:
break;
case RegexStringComparator:
case SubstringComparator:
this.value = Bytes.toString(comparator.getValue());
break;
default:
throw new RuntimeException("unhandled filter type: " + type);
}
}
示例2: WritableByteArrayComparableModel
import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
public WritableByteArrayComparableModel(
WritableByteArrayComparable comparator) {
String typeName = comparator.getClass().getSimpleName();
ComparatorType type = ComparatorType.valueOf(typeName);
this.type = typeName;
switch (type) {
case BinaryComparator:
case BinaryPrefixComparator:
this.value = Base64.encodeBytes(comparator.getValue());
break;
case BitComparator:
this.value = Base64.encodeBytes(comparator.getValue());
this.op = ((BitComparator)comparator).getOperator().toString();
break;
case NullComparator:
break;
case RegexStringComparator:
case SubstringComparator:
this.value = Bytes.toString(comparator.getValue());
break;
default:
throw new RuntimeException("unhandled filter type: " + type);
}
}
示例3: convertScanToString
import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
private static String convertScanToString(Scan scan) {
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(out);
scan.write(dos);
return Base64.encodeBytes(out.toByteArray());
} catch (IOException e) {
LOG.error(e);
return "";
}
}
示例4: convertScanToString
import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
* 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{
ObjectOutput dos=null;
try{
byte[] bytes=ProtobufUtil.toScan(scan).toByteArray();
return Base64.encodeBytes(bytes);
}finally{
if(dos!=null)
dos.close();
}
}
示例5: convertScanToString
import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
static String convertScanToString(Scan scan) throws IOException {
ClientProtos.Scan proto = ProtobufUtil.toScan(scan);
return Base64.encodeBytes(proto.toByteArray());
}
示例6: convertScanToString
import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
static String convertScanToString(Scan scan) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(out);
scan.write(dos);
return Base64.encodeBytes(out.toByteArray());
}
示例7: encode
import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
private String encode(String value) {
return Base64.encodeBytes(value.getBytes(UTF8));
}
示例8: encode
import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
private String encode(String value) {
return Base64.encodeBytes(value.getBytes(StandardCharsets.UTF_8));
}
示例9: encodeUrl
import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
private String encodeUrl(String value) {
return Base64.encodeBytes(value.getBytes(StandardCharsets.UTF_8));
}
示例10: convertScanToString
import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
* 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());
}
示例11: convertScanToString
import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
* 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());
}
示例12: convertScanToString
import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
* 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());
}
示例13: convertScanToString
import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
* 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());
}
示例14: convertScanToString
import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
* 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());
}
示例15: convertScanToString
import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
* 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.
*/
private static String convertScanToString(Scan scan) throws IOException {
ClientProtos.Scan proto = ProtobufUtil.toScan(scan);
return Base64.encodeBytes(proto.toByteArray());
}