package sharin.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.Writer;

public class IoUtils {

    public static int read(Reader reader) {

        try {
            return reader.read();

        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public static void write(Writer writer, String str) {

        try {
            writer.write(str);

        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public static void close(InputStream in) {

        try {
            in.close();

        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
