本文整理了Java中net.iharder.Base64.encode3to4()
方法的一些代码示例,展示了Base64.encode3to4()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Base64.encode3to4()
方法的具体详情如下:
包路径:net.iharder.Base64
类名称:Base64
方法名:encode3to4
[英]Encodes the first three bytes of array threeBytes and returns a four-byte array in Base64 notation.
[中]将数组的前三个字节编码为三字节,并以Base64表示法返回一个四字节数组。
代码示例来源:origin: uk.org.mygrid.taverna/taverna-contrib
/**
* Encodes the first three bytes of array <var>threeBytes</var> and returns
* a four-byte array in Base64 notation.
*
* @param threeBytes
* the array to convert
* @return four byte array in Base64 notation.
* @since 1.3
*/
private static byte[] encode3to4(byte[] threeBytes) {
return encode3to4(threeBytes, 3);
} // end encodeToBytes
代码示例来源:origin: uk.org.mygrid.taverna/taverna-contrib
/**
* Encodes up to the first three bytes of array <var>threeBytes</var> and
* returns a four-byte array in Base64 notation. The actual number of
* significant bytes in your array is given by <var>numSigBytes</var>. The
* array <var>threeBytes</var> needs only be as big as <var>numSigBytes</var>.
*
* @param threeBytes
* the array to convert
* @param numSigBytes
* the number of significant bytes in your array
* @return four byte array in Base64 notation.
* @since 1.3
*/
private static byte[] encode3to4(byte[] threeBytes, int numSigBytes) {
byte[] dest = new byte[4];
encode3to4(threeBytes, 0, numSigBytes, dest, 0);
return dest;
}
代码示例来源:origin: pelotoncycle/weberknecht
/**
* Encodes up to the first three bytes of array <var>threeBytes</var>
* and returns a four-byte array in Base64 notation.
* The actual number of significant bytes in your array is
* given by <var>numSigBytes</var>.
* The array <var>threeBytes</var> needs only be as big as
* <var>numSigBytes</var>.
* Code can reuse a byte array by passing a four-byte array as <var>b4</var>.
*
* @param b4 A reusable byte array to reduce array instantiation
* @param threeBytes the array to convert
* @param numSigBytes the number of significant bytes in your array
* @return four byte array in Base64 notation.
* @since 1.5.1
*/
private static byte[] encode3to4( byte[] b4, byte[] threeBytes, int numSigBytes, int options ) {
encode3to4( threeBytes, 0, numSigBytes, b4, 0, options );
return b4;
} // end encode3to4
代码示例来源:origin: Nextdoor/bender
/**
* Encodes up to the first three bytes of array <var>threeBytes</var>
* and returns a four-byte array in Base64 notation.
* The actual number of significant bytes in your array is
* given by <var>numSigBytes</var>.
* The array <var>threeBytes</var> needs only be as big as
* <var>numSigBytes</var>.
* Code can reuse a byte array by passing a four-byte array as <var>b4</var>.
*
* @param b4 A reusable byte array to reduce array instantiation
* @param threeBytes the array to convert
* @param numSigBytes the number of significant bytes in your array
* @return four byte array in Base64 notation.
* @since 1.5.1
*/
private static byte[] encode3to4( byte[] b4, byte[] threeBytes, int numSigBytes, int options ) {
encode3to4( threeBytes, 0, numSigBytes, b4, 0, options );
return b4;
} // end encode3to4
代码示例来源:origin: uk.org.mygrid.taverna/taverna-contrib
/**
* Encodes up to the first three bytes of array <var>threeBytes</var> and
* returns a four-byte array in Base64 notation. The actual number of
* significant bytes in your array is given by <var>numSigBytes</var>. The
* array <var>threeBytes</var> needs only be as big as <var>numSigBytes</var>.
* Code can reuse a byte array by passing a four-byte array as <var>b4</var>.
*
* @param b4
* A reusable byte array to reduce array instantiation
* @param threeBytes
* the array to convert
* @param numSigBytes
* the number of significant bytes in your array
* @return four byte array in Base64 notation.
* @since 1.5.1
*/
private static byte[] encode3to4(byte[] b4, byte[] threeBytes, int numSigBytes) {
encode3to4(threeBytes, 0, numSigBytes, b4, 0);
return b4;
} // end encode3to4
代码示例来源:origin: pelotoncycle/weberknecht
/**
* Performs Base64 encoding on the <code>raw</code> ByteBuffer,
* writing it to the <code>encoded</code> ByteBuffer.
* This is an experimental feature. Currently it does not
* pass along any options (such as {@link #DO_BREAK_LINES}
* or {@link #GZIP}.
*
* @param raw input buffer
* @param encoded output buffer
* @since 2.3
*/
public static void encode( java.nio.ByteBuffer raw, java.nio.ByteBuffer encoded ){
byte[] raw3 = new byte[3];
byte[] enc4 = new byte[4];
while( raw.hasRemaining() ){
int rem = Math.min(3,raw.remaining());
raw.get(raw3,0,rem);
Base64.encode3to4(enc4, raw3, rem, Base64.NO_OPTIONS );
encoded.put(enc4);
} // end input remaining
}
代码示例来源:origin: Nextdoor/bender
/**
* Performs Base64 encoding on the <code>raw</code> ByteBuffer,
* writing it to the <code>encoded</code> ByteBuffer.
* This is an experimental feature. Currently it does not
* pass along any options (such as {@link #DO_BREAK_LINES}
* or {@link #GZIP}.
*
* @param raw input buffer
* @param encoded output buffer
* @since 2.3
*/
public static void encode( java.nio.ByteBuffer raw, java.nio.ByteBuffer encoded ){
byte[] raw3 = new byte[3];
byte[] enc4 = new byte[4];
while( raw.hasRemaining() ){
int rem = Math.min(3,raw.remaining());
raw.get(raw3,0,rem);
Base64.encode3to4(enc4, raw3, rem, Base64.NO_OPTIONS );
encoded.put(enc4);
} // end input remaining
}
代码示例来源:origin: Nextdoor/bender
/**
* Performs Base64 encoding on the <code>raw</code> ByteBuffer,
* writing it to the <code>encoded</code> CharBuffer.
* This is an experimental feature. Currently it does not
* pass along any options (such as {@link #DO_BREAK_LINES}
* or {@link #GZIP}.
*
* @param raw input buffer
* @param encoded output buffer
* @since 2.3
*/
public static void encode( java.nio.ByteBuffer raw, java.nio.CharBuffer encoded ){
byte[] raw3 = new byte[3];
byte[] enc4 = new byte[4];
while( raw.hasRemaining() ){
int rem = Math.min(3,raw.remaining());
raw.get(raw3,0,rem);
Base64.encode3to4(enc4, raw3, rem, Base64.NO_OPTIONS );
for( int i = 0; i < 4; i++ ){
encoded.put( (char)(enc4[i] & 0xFF) );
}
} // end input remaining
}
代码示例来源:origin: pelotoncycle/weberknecht
/**
* Performs Base64 encoding on the <code>raw</code> ByteBuffer,
* writing it to the <code>encoded</code> CharBuffer.
* This is an experimental feature. Currently it does not
* pass along any options (such as {@link #DO_BREAK_LINES}
* or {@link #GZIP}.
*
* @param raw input buffer
* @param encoded output buffer
* @since 2.3
*/
public static void encode( java.nio.ByteBuffer raw, java.nio.CharBuffer encoded ){
byte[] raw3 = new byte[3];
byte[] enc4 = new byte[4];
while( raw.hasRemaining() ){
int rem = Math.min(3,raw.remaining());
raw.get(raw3,0,rem);
Base64.encode3to4(enc4, raw3, rem, Base64.NO_OPTIONS );
for( int i = 0; i < 4; i++ ){
encoded.put( (char)(enc4[i] & 0xFF) );
}
} // end input remaining
}
代码示例来源:origin: pelotoncycle/weberknecht
int lineLength = 0;
for( ; d < len2; d+=3, e+=4 ) {
encode3to4( source, d+off, 3, outBuff, e, options );
encode3to4( source, d+off, len - d, outBuff, e, options );
e += 4;
代码示例来源:origin: uk.org.mygrid.taverna/taverna-contrib
int lineLength = 0;
for (; d < len2; d += 3, e += 4) {
encode3to4(source, d + off, 3, outBuff, e);
encode3to4(source, d + off, len - d, outBuff, e);
e += 4;
代码示例来源:origin: Nextdoor/bender
int lineLength = 0;
for( ; d < len2; d+=3, e+=4 ) {
encode3to4( source, d+off, 3, outBuff, e, options );
encode3to4( source, d+off, len - d, outBuff, e, options );
e += 4;
内容来源于网络,如有侵权,请联系作者删除!