![JAR search and dependency download from the Maven repository](/logo.png)
com.github.andyshao.util.Resources Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Useful-Tools Show documentation
Show all versions of Useful-Tools Show documentation
Some thing about the useful tools of the JDK 1.8.
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