本文整理了Java中org.apache.calcite.avatica.util.ByteString.parseBase64()
方法的一些代码示例,展示了ByteString.parseBase64()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteString.parseBase64()
方法的具体详情如下:
包路径:org.apache.calcite.avatica.util.ByteString
类名称:ByteString
方法名:parseBase64
[英]Parses a Base64 to a byte array.
[中]将Base64解析为字节数组。
代码示例来源:origin: org.apache.calcite.avatica/avatica-core
private byte[] getBase64Decoded() throws SQLException {
final String string = super.getString();
if (null == string) {
return null;
}
// Need to base64 decode the string.
return ByteString.parseBase64(string);
}
代码示例来源:origin: org.apache.calcite.avatica/avatica-core
/**
* Creates a byte string from a Base64 string.
*
* @param string Base64 string
* @return Byte string
*/
public static ByteString ofBase64(String string) {
final byte[] bytes = parseBase64(string);
return new ByteString(bytes, false);
}
代码示例来源:origin: apache/calcite-avatica
private byte[] getBase64Decoded() throws SQLException {
final String string = super.getString();
if (null == string) {
return null;
}
// Need to base64 decode the string.
return ByteString.parseBase64(string);
}
代码示例来源:origin: org.apache.calcite/calcite-avatica
private byte[] getBase64Decoded() {
final String string = super.getString();
if (null == string) {
return null;
}
// Need to base64 decode the string.
return ByteString.parseBase64(string);
}
代码示例来源:origin: org.apache.calcite/calcite-avatica
/**
* Creates a byte string from a Base64 string.
*
* @param string Base64 string
* @return Byte string
*/
public static ByteString ofBase64(String string) {
final byte[] bytes = parseBase64(string);
return new ByteString(bytes, false);
}
代码示例来源:origin: apache/calcite-avatica
/**
* Creates a byte string from a Base64 string.
*
* @param string Base64 string
* @return Byte string
*/
public static ByteString ofBase64(String string) {
final byte[] bytes = parseBase64(string);
return new ByteString(bytes, false);
}
代码示例来源:origin: org.apache.calcite.avatica/avatica-core
@Override public byte[] getBytes() throws SQLException {
Object obj = getObject();
if (null == obj) {
return null;
}
if (obj instanceof ByteString) {
return ((ByteString) obj).getBytes();
} else if (obj instanceof String) {
// Need to unwind the base64 for JSON
return ByteString.parseBase64((String) obj);
} else if (obj instanceof byte[]) {
// Protobuf would have a byte array
return (byte[]) obj;
} else {
throw new RuntimeException("Cannot handle " + obj.getClass() + " as bytes");
}
}
代码示例来源:origin: apache/calcite-avatica
@Override public byte[] getBytes() throws SQLException {
Object obj = getObject();
if (null == obj) {
return null;
}
if (obj instanceof ByteString) {
return ((ByteString) obj).getBytes();
} else if (obj instanceof String) {
// Need to unwind the base64 for JSON
return ByteString.parseBase64((String) obj);
} else if (obj instanceof byte[]) {
// Protobuf would have a byte array
return (byte[]) obj;
} else {
throw new RuntimeException("Cannot handle " + obj.getClass() + " as bytes");
}
}
代码示例来源:origin: org.apache.calcite.avatica/avatica-core
bytes = ByteString.parseBase64((String) o);
} else {
代码示例来源:origin: apache/calcite-avatica
bytes = ByteString.parseBase64((String) o);
} else {
内容来源于网络,如有侵权,请联系作者删除!