/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.redkale.convert.ext;

import org.redkale.convert.*;
import org.redkale.util.StringWrapper;

/**
 * String 的SimpledCoder实现
 *
 * <p>
 * 详情见: https://redkale.org
 *
 * @author zhangjx
 * @param <R> Reader输入的子类型
 * @param <W> Writer输出的子类型
 */
public final class StringWrapperSimpledCoder<R extends Reader, W extends Writer> extends SimpledCoder<R, W, StringWrapper> {

    public static final StringWrapperSimpledCoder instance = new StringWrapperSimpledCoder();

    @Override
    public void convertTo(W out, StringWrapper value) {
        out.writeWrapper(value);
    }

    @Override
    public StringWrapper convertFrom(R in) {
        return new StringWrapper(in.readString());
    }

}
