All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zodiac.netty.marshallers.CharSequenceInterperter Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version
package org.zodiac.netty.marshallers;

import io.netty.buffer.ByteBuf;
import java.nio.charset.Charset;
import org.zodiac.sdk.toolkit.marshallers.Marshaller;

final class CharSequenceInterperter implements Marshaller {

    public CharSequenceInterperter() {
        super();
    }

    @Override
    public CharSequence read(ByteBuf data, Object[] hints) throws Exception {
        Charset charset = NettyContentMarshallers.findCharset(hints);
        return data.getCharSequence(0, data.readableBytes(), charset);
    }

    @Override
    public void write(CharSequence obj, ByteBuf into, Object[] hints) throws Exception {
        Charset charset = NettyContentMarshallers.findCharset(hints);
        into.writeCharSequence(obj, charset);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy