org.zodiac.netty.marshallers.CharSequenceInterperter Maven / Gradle / Ivy
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