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

com.github.andyshao.util.Resources Maven / Gradle / Ivy

There is a newer version: 4.0
Show newest version
package com.github.andyshao.util;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
import java.nio.channels.AsynchronousByteChannel;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.WritableByteChannel;

/**
 * 
 * Title:
* Descript:
* Copyright: Copryright(c) Mar 18, 2014
* Encoding:UNIX UTF-8 * * @author Andy.Shao * */ @Deprecated public class Resources { public static InputStream getInputStream(AsynchronousByteChannel channel) { return Channels.newInputStream(channel); } public static InputStream getInputStream(ReadableByteChannel channel) { return Channels.newInputStream(channel); } public static OutputStream getOutputStream(AsynchronousByteChannel channel) { return Channels.newOutputStream(channel); } public static OutputStream getOutputStream(WritableByteChannel channel) { return Channels.newOutputStream(channel); } public static ReadableByteChannel getReadableByteChannel(InputStream inputStream) { return Channels.newChannel(inputStream); } public static Reader getReader(InputStream inputStream) { return new InputStreamReader(inputStream); } public static WritableByteChannel getWritableByteChannel(OutputStream outputStream) { return Channels.newChannel(outputStream); } public static Writer getWriter(OutputStream outputStream) { return new OutputStreamWriter(outputStream); } private Resources() { throw new AssertionError("No support instance " + Reflects.class.getName()); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy