Example usage for io.netty.handler.codec.base64 Base64Dialect STANDARD

List of usage examples for io.netty.handler.codec.base64 Base64Dialect STANDARD

Introduction

In this page you can find the example usage for io.netty.handler.codec.base64 Base64Dialect STANDARD.

Prototype

Base64Dialect STANDARD

To view the source code for io.netty.handler.codec.base64 Base64Dialect STANDARD.

Click Source Link

Document

Standard Base64 encoding as described in the Section 3 of <a href="http://www.faqs.org/rfcs/rfc3548.html">RFC3548</a>.

Usage

From source file:ratpack.session.clientside.internal.ClientSideSessionStore.java

License:Apache License

private String toBase64(ByteBuf byteBuf) {
    ByteBuf encoded = Base64.encode(byteBuf, false, Base64Dialect.STANDARD);
    try {//from  w  ww .j  a  v a2s.  c  om
        return encoded.toString(CharsetUtil.ISO_8859_1);
    } finally {
        encoded.release();
    }
}

From source file:ratpack.session.clientside.internal.ClientSideSessionStore.java

License:Apache License

private ByteBuf fromBase64(ByteBufAllocator bufferAllocator, String string) {
    ByteBuf byteBuf = ByteBufUtil.encodeString(bufferAllocator, CharBuffer.wrap(string),
            CharsetUtil.ISO_8859_1);/*w w w  .  j av  a  2 s.  c o m*/
    try {
        return Base64.decode(byteBuf, Base64Dialect.STANDARD);
    } finally {
        byteBuf.release();
    }
}