本文整理了Java中org.apache.felix.framework.util.Util.encode()
方法的一些代码示例,展示了Util.encode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.encode()
方法的具体详情如下:
包路径:org.apache.felix.framework.util.Util
类名称:Util
方法名:encode
[英]Encode a raw byte array to a Base64 String.
[中]将原始字节数组编码为Base64字符串。
代码示例来源:origin: org.apache.servicemix.kernel/org.apache.servicemix.kernel.main
public static String base64Encode(String s) throws IOException
{
return encode(s.getBytes(), 0);
}
代码示例来源:origin: apache/felix
public static String base64Encode(String s) throws IOException
{
return encode(s.getBytes(), 0);
}
代码示例来源:origin: apache/felix
/**
* Encode a raw byte array to a Base64 String.
*
* @param in Byte array to encode.
* @param len Length of Base64 lines. 0 means no line breaks.
**/
public static String encode(byte[] in, int len) throws IOException
{
ByteArrayOutputStream baos = null;
ByteArrayInputStream bais = null;
try
{
baos = new ByteArrayOutputStream();
bais = new ByteArrayInputStream(in);
encode(bais, baos, len);
// ASCII byte array to String
return (new String(baos.toByteArray()));
}
finally
{
if (baos != null)
{
baos.close();
}
if (bais != null)
{
bais.close();
}
}
}
代码示例来源:origin: org.apache.servicemix.kernel/org.apache.servicemix.kernel.main
/**
* Encode a raw byte array to a Base64 String.
*
* @param in Byte array to encode.
* @param len Length of Base64 lines. 0 means no line breaks.
**/
public static String encode(byte[] in, int len) throws IOException
{
ByteArrayOutputStream baos = null;
ByteArrayInputStream bais = null;
try
{
baos = new ByteArrayOutputStream();
bais = new ByteArrayInputStream(in);
encode(bais, baos, len);
// ASCII byte array to String
return (new String(baos.toByteArray()));
}
finally
{
if (baos != null)
{
baos.close();
}
if (bais != null)
{
bais.close();
}
}
}
内容来源于网络,如有侵权,请联系作者删除!