Home » Core Java » apache » commons » codec

codec

org.apache.commons.codec.binary.Base64OutputStream Example

Base64OutputStream has constructors with parameter for encoding (default behavior) and decoding in a streaming fashion for unlimited size. The default line length is 76 characters for encoding. The default lineEnding is CRLF. Base64InputStream has default behavior for decoding. There are other constructors for Base64OutputStream and Base64InputStream has different constructors to override default behavior. Base64OutputStream takes byte streams instead of character ...

Read More »

org.apache.commons.codec.binary.base64 Example

Base64 class is used for  Base64 encoding and decoding as defined by RFC 2045.  There are various constructors with  URL-Safe mode, Line Length and Line Separator parameters. The URL Safe parameter is used to encode operations. Decoding handles URL safe mode on and off.  Bytestreams are used directly by Base64 class. Character streams are not used. ThreadSafe Base64 class has ...

Read More »

Decode Base64

This is an example of how to decode Strings with the Base64 algorithm. We are using the org.apache.commons.codec.binary.Base64 class that provides Base64 encoding and decoding as defined by RFC 2045. Decoding with org.apache.commons.codec.binary.Base64 class implies that you should: Create a String. Get the bytes from the String, using getBytes() API method of String. Use decodeBase64(byte[] base64Data) API method, using the byte ...

Read More »

Encode Base64

In this example we shall show you how to encode Strings with the Base64 algorithm. We are using the org.apache.commons.codec.binary.Base64 class that provides Base64 encoding and decoding as defined by RFC 2045. To encode a String with Base64 one should perform the following steps: Create a String. Get the bytes from the String, using getBytes() API method of String. Use encodeBase64(byte[] ...

Read More »