Performs Base64 encoding on the raw ByteBuffer, writing it to the encoded ByteBuffer. This is an experimental feature. Currently it does not pass along any options (such as #DO_BREAK_LINES or #GZIP. @param raw input buffer @param encoded output buffer @sinc
( java.nio.ByteBuffer raw, java.nio.ByteBuffer encoded )
| 545 | * @since 2.3 |
| 546 | */ |
| 547 | public static void encode( java.nio.ByteBuffer raw, java.nio.ByteBuffer encoded ){ |
| 548 | byte[] raw3 = new byte[3]; |
| 549 | byte[] enc4 = new byte[4]; |
| 550 | |
| 551 | while( raw.hasRemaining() ){ |
| 552 | int rem = Math.min(3,raw.remaining()); |
| 553 | raw.get(raw3,0,rem); |
| 554 | Base64.encode3to4(enc4, raw3, rem, Base64.NO_OPTIONS ); |
| 555 | encoded.put(enc4); |
| 556 | } // end input remaining |
| 557 | } |
| 558 | |
| 559 | |
| 560 | /** |
nothing calls this directly
no test coverage detected