public class Streams extends Object
Modifier and Type | Method and Description |
---|---|
static void |
byteArrayConsumer(InputStream input,
byte[] buffer,
IntConsumer consumer) |
static ByteArrayIterator |
byteArrayIterator(InputStream input,
byte[] buffer) |
static void |
close(AutoCloseable c) |
static void |
close(AutoCloseable c,
boolean close) |
static void |
flush(Flushable f) |
static void |
flush(Flushable f,
boolean flush) |
static void |
lineConsumer(InputStream in,
Consumer<String> c) |
static void |
lineConsumer(InputStream in,
String charset,
Consumer<String> c) |
static void |
lineConsumer(Reader reader,
Consumer<String> c) |
static void |
lineConsumer(Reader reader,
int bufferSize,
Consumer<String> c) |
static LineIterator |
lineIterator(InputStream input) |
static LineIterator |
lineIterator(InputStream input,
String charset) |
static LineIterator |
lineIterator(Reader reader) |
static String |
md5(InputStream in)
流 MD5 签名
|
static String |
sha1(InputStream in)
流 SHA1 签名
|
static String |
sha224(InputStream in)
流 SHA224 签名
|
static String |
sha256(InputStream in)
流 SHA256 签名
|
static String |
sha384(InputStream in)
流 SHA384 签名
|
static String |
sha512(InputStream in)
流 SHA512 签名
|
static String |
sign(InputStream in,
HashDigest type)
散列签名
|
static long |
skip(InputStream in,
long skip)
循环跳过
|
static BufferedReader |
toBufferedReader(Reader reader) |
static BufferedReader |
toBufferedReader(Reader reader,
int bufferSize) |
static BufferedWriter |
toBufferedWriter(Writer writer) |
static BufferedWriter |
toBufferedWriter(Writer writer,
int bufferSize) |
static byte[] |
toByteArray(InputStream input) |
static byte[] |
toByteArray(Reader input) |
static byte[] |
toByteArray(Reader input,
String charset) |
static char[] |
toCharArray(InputStream is) |
static char[] |
toCharArray(InputStream is,
String charset) |
static char[] |
toCharArray(Reader input) |
static InputStream |
toInputStream(byte[] bs) |
static InputStream |
toInputStream(byte[] bs,
int off,
int len) |
static InputStream |
toInputStream(String input) |
static InputStream |
toInputStream(String input,
String charset) |
static OutputStream |
toOutputStream(byte[] bs) |
static OutputStream |
toOutputStream(byte[] bs,
int off,
int len) |
static OutputStream |
toOutputStream(String input) |
static OutputStream |
toOutputStream(String input,
String charset) |
static String |
toString(byte[] input) |
static String |
toString(byte[] input,
String charset) |
static String |
toString(InputStream input) |
static String |
toString(InputStream input,
String charset) |
static String |
toString(Reader input) |
static int |
transfer(InputStream input,
OutputStream output) |
static void |
transfer(InputStream input,
Writer output) |
static void |
transfer(InputStream input,
Writer output,
String charset) |
static int |
transfer(RandomAccessFile access,
OutputStream output) |
static void |
transfer(Reader input,
OutputStream output) |
static void |
transfer(Reader input,
OutputStream output,
String charset) |
static int |
transfer(Reader input,
Writer output) |
static long |
transferLarge(InputStream input,
OutputStream output) |
static long |
transferLarge(RandomAccessFile access,
OutputStream output) |
static long |
transferLarge(Reader input,
Writer output) |
public static void close(AutoCloseable c)
public static void close(AutoCloseable c, boolean close)
public static void flush(Flushable f)
public static void flush(Flushable f, boolean flush)
public static long skip(InputStream in, long skip) throws IOException
in
- inskip
- skipIOException
- IOExceptionpublic static BufferedReader toBufferedReader(Reader reader)
public static BufferedReader toBufferedReader(Reader reader, int bufferSize)
public static BufferedWriter toBufferedWriter(Writer writer)
public static BufferedWriter toBufferedWriter(Writer writer, int bufferSize)
public static int transfer(RandomAccessFile access, OutputStream output) throws IOException
IOException
public static long transferLarge(RandomAccessFile access, OutputStream output) throws IOException
IOException
public static int transfer(InputStream input, OutputStream output) throws IOException
IOException
public static long transferLarge(InputStream input, OutputStream output) throws IOException
IOException
public static void transfer(InputStream input, Writer output) throws IOException
IOException
public static void transfer(InputStream input, Writer output, String charset) throws IOException
IOException
public static int transfer(Reader input, Writer output) throws IOException
IOException
public static long transferLarge(Reader input, Writer output) throws IOException
IOException
public static void transfer(Reader input, OutputStream output) throws IOException
IOException
public static void transfer(Reader input, OutputStream output, String charset) throws IOException
IOException
public static byte[] toByteArray(InputStream input) throws IOException
IOException
public static byte[] toByteArray(Reader input) throws IOException
IOException
public static byte[] toByteArray(Reader input, String charset) throws IOException
IOException
public static char[] toCharArray(InputStream is) throws IOException
IOException
public static char[] toCharArray(InputStream is, String charset) throws IOException
IOException
public static char[] toCharArray(Reader input) throws IOException
IOException
public static String toString(InputStream input) throws IOException
IOException
public static String toString(InputStream input, String charset) throws IOException
IOException
public static String toString(Reader input) throws IOException
IOException
public static String toString(byte[] input) throws IOException
IOException
public static String toString(byte[] input, String charset) throws IOException
IOException
public static InputStream toInputStream(byte[] bs)
public static InputStream toInputStream(byte[] bs, int off, int len)
public static InputStream toInputStream(String input)
public static InputStream toInputStream(String input, String charset)
public static OutputStream toOutputStream(byte[] bs)
public static OutputStream toOutputStream(byte[] bs, int off, int len)
public static OutputStream toOutputStream(String input)
public static OutputStream toOutputStream(String input, String charset)
public static String md5(InputStream in)
in
- 流public static String sha1(InputStream in)
in
- 流public static String sha224(InputStream in)
in
- 流public static String sha256(InputStream in)
in
- 流public static String sha384(InputStream in)
in
- 流public static String sha512(InputStream in)
in
- 流public static String sign(InputStream in, HashDigest type)
in
- 流type
- 加密类型 MD5 SHA-1 SHA-224 SHA-256 SHA-384 SHA-512public static void lineConsumer(InputStream in, Consumer<String> c) throws IOException
IOException
public static void lineConsumer(InputStream in, String charset, Consumer<String> c) throws IOException
IOException
public static void lineConsumer(Reader reader, Consumer<String> c) throws IOException
IOException
public static void lineConsumer(Reader reader, int bufferSize, Consumer<String> c) throws IOException
IOException
public static LineIterator lineIterator(Reader reader)
public static LineIterator lineIterator(InputStream input)
public static LineIterator lineIterator(InputStream input, String charset) throws IOException
IOException
public static void byteArrayConsumer(InputStream input, byte[] buffer, IntConsumer consumer) throws IOException
IOException
public static ByteArrayIterator byteArrayIterator(InputStream input, byte[] buffer)
Copyright © 2025. All rights reserved.