public class StreamUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
copy(java.io.InputStream inputStream,
java.io.OutputStream outputStream,
int buffSize)
Copies bytes from input stream (from current byte to EOF byte) to output stream.
|
static byte[] |
readBytes(java.io.InputStream in)
Reads all bytes to EOF of stream and returns these bytes.
|
static int |
readInteger(java.io.InputStream is)
Reads an integer value, stored as four bytes, low byte first.
|
static int |
readToBuffer(java.io.InputStream inputStream,
byte[] buf) |
static void |
writeInteger(java.io.OutputStream out,
int data)
Writes an
data to the specified output stream as four
bytes, low byte first. |
public static void writeInteger(java.io.OutputStream out, int data) throws java.io.IOException
data
to the specified output stream as four
bytes, low byte first.out
- an output stream.data
- a value to save.java.io.IOException
public static int readInteger(java.io.InputStream is) throws java.io.IOException
is
- an input stream.java.io.IOException
public static byte[] readBytes(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static void copy(java.io.InputStream inputStream, java.io.OutputStream outputStream, int buffSize) throws java.io.IOException
inputStream
- input streamoutputStream
- output streamjava.io.IOException
public static int readToBuffer(java.io.InputStream inputStream, byte[] buf) throws java.io.IOException
java.io.IOException