public class StreamUtils extends Object
| 构造器和说明 |
|---|
StreamUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
dumpArray(byte[] b) |
static String |
dumpArray(byte[] b,
int pos,
int len) |
static String |
dumpArrayHex(byte[] b) |
static String |
dumpArrayHex(byte[] b,
int pos,
int len) |
static String |
dumpHex(byte[] b) |
static String |
dumpHex(byte[] b,
int pos,
int len) |
static String |
dumpMessage(byte[] b) |
static String |
dumpMessage(byte[] b,
int pos,
int len) |
static byte[] |
fromHex(String s) |
static byte[] |
read(InputStream in) |
static char[] |
read(Reader reader) |
static short |
read2ByteSigned(InputStream in) |
static int |
read2ByteUnsigned(InputStream in) |
static int |
read4ByteSigned(InputStream in) |
static long |
read4ByteUnsigned(InputStream in) |
static byte |
readByte(InputStream in) |
static char |
readChar(InputStream in) |
static String |
readFile(File file) |
static String |
readFile(String filename) |
static List<String> |
readLines(File file) |
static List<String> |
readLines(String filename) |
static void |
readLines(String filename,
LineHandler lineHandler) |
static String |
readString(InputStream in,
int length) |
static String |
toHex(byte b) |
static String |
toHex(byte[] bs) |
static String |
toHex(int i) |
static String |
toHex(long l) |
static String |
toHex(short s) |
static void |
transfer(InputStream in,
OutputStream out) |
static void |
transfer(InputStream in,
OutputStream out,
long limit) |
static void |
transfer(InputStream in,
SocketChannel out) |
static void |
transfer(Reader reader,
Writer writer) |
static void |
transfer(Reader reader,
Writer writer,
long limit) |
static void |
write2ByteSigned(OutputStream out,
short s) |
static void |
write2ByteUnsigned(OutputStream out,
int i) |
static void |
write4ByteSigned(OutputStream out,
int i) |
static void |
write4ByteUnsigned(OutputStream out,
long l) |
static void |
writeByte(OutputStream out,
byte b) |
static void |
writeChar(OutputStream out,
char c) |
static void |
writeFile(File file,
String content) |
static void |
writeFile(String filename,
String content) |
static void |
writeString(OutputStream out,
String s) |
public static void transfer(InputStream in, OutputStream out) throws IOException
IOExceptionpublic static void transfer(InputStream in, OutputStream out, long limit) throws IOException
IOExceptionpublic static void transfer(InputStream in, SocketChannel out) throws IOException
IOExceptionpublic static void transfer(Reader reader, Writer writer) throws IOException
IOExceptionpublic static void transfer(Reader reader, Writer writer, long limit) throws IOException
IOExceptionpublic static byte[] read(InputStream in) throws IOException
IOExceptionpublic static char[] read(Reader reader) throws IOException
IOExceptionpublic static char readChar(InputStream in) throws IOException
IOExceptionpublic static String readString(InputStream in, int length) throws IOException
IOExceptionpublic static byte readByte(InputStream in) throws IOException
IOExceptionpublic static int read4ByteSigned(InputStream in) throws IOException
IOExceptionpublic static long read4ByteUnsigned(InputStream in) throws IOException
IOExceptionpublic static int read2ByteUnsigned(InputStream in) throws IOException
IOExceptionpublic static short read2ByteSigned(InputStream in) throws IOException
IOExceptionpublic static void writeByte(OutputStream out, byte b) throws IOException
IOExceptionpublic static void writeChar(OutputStream out, char c) throws IOException
IOExceptionpublic static void writeString(OutputStream out, String s) throws IOException
IOExceptionpublic static void write4ByteSigned(OutputStream out, int i) throws IOException
IOExceptionpublic static void write4ByteUnsigned(OutputStream out, long l) throws IOException
IOExceptionpublic static void write2ByteUnsigned(OutputStream out, int i) throws IOException
IOExceptionpublic static void write2ByteSigned(OutputStream out, short s) throws IOException
IOExceptionpublic static String dumpArray(byte[] b)
public static String dumpArray(byte[] b, int pos, int len)
public static String dumpMessage(byte[] b)
public static String dumpMessage(byte[] b, int pos, int len)
public static String dumpArrayHex(byte[] b)
public static String dumpArrayHex(byte[] b, int pos, int len)
public static String dumpHex(byte[] b)
public static String dumpHex(byte[] b, int pos, int len)
public static String readFile(String filename) throws IOException
IOExceptionpublic static String readFile(File file) throws IOException
IOExceptionpublic static List<String> readLines(String filename) throws IOException
IOExceptionpublic static List<String> readLines(File file) throws IOException
IOExceptionpublic static void writeFile(String filename, String content) throws IOException
IOExceptionpublic static void writeFile(File file, String content) throws IOException
IOExceptionpublic static void readLines(String filename, LineHandler lineHandler) throws IOException
IOExceptionpublic static String toHex(byte[] bs)
public static String toHex(byte b)
public static String toHex(short s)
public static String toHex(int i)
public static String toHex(long l)
public static byte[] fromHex(String s)
Copyright © 2018. All rights reserved.