|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jagatoo.util.streams.StreamUtils
public class StreamUtils
Contains static utility methods for Stream.
| Constructor Summary | |
|---|---|
StreamUtils()
|
|
| Method Summary | |
|---|---|
static byte[] |
buildByteArray(java.io.InputStream in)
This calls buildByteArray(InputStream, int) with an initialSize
of in.available(). |
static byte[] |
buildByteArray(java.io.InputStream in,
int initialSize)
Builds a byte-array from the given InputStream. |
static byte |
readByte(java.io.BufferedInputStream in)
Reads one byte from the InputStream. |
static byte |
readByte(java.io.InputStream in)
Reads one byte from the InputStream. |
static void |
readBytes(java.io.BufferedInputStream in,
int bytesToRead,
byte[] buffer,
int bufferOffset)
Reads bytesToRead bytes from the stream. |
static void |
readBytes(java.io.InputStream in,
int bytesToRead,
byte[] buffer,
int bufferOffset)
Reads bytesToRead bytes from the stream. |
static java.lang.String |
readCString(java.io.InputStream in,
int maxLength,
boolean alwaysReadMaxLength)
Reads a String from the InputStream. |
static int |
readInt(java.io.BufferedInputStream in)
Reads one (signed) int from the stream. |
static int |
readInt(java.io.InputStream in)
Reads one (signed) int from the stream. |
static short |
readShort(java.io.BufferedInputStream in)
Reads two bytes from the InputStream stored in a short-value. |
static short |
readShort(java.io.InputStream in)
Reads two bytes from the InputStream stored in a short-value. |
static int |
readSwappedInt(java.io.BufferedInputStream in)
Reads one (signed) int from the stream. |
static int |
readSwappedInt(java.io.InputStream in)
Reads one (signed) int from the stream. |
static short |
readSwappedShort(java.io.BufferedInputStream in)
Reads two bytes from the InputStream stored in a short-value. |
static short |
readSwappedShort(java.io.InputStream in)
Reads two bytes from the InputStream stored in a short-value. |
static int |
readSwappedUnsignedShort(java.io.BufferedInputStream in)
Reads two bytes from the InputStream, convertes them to a short and stores them to an int to preserve the sign. |
static int |
readSwappedUnsignedShort(java.io.InputStream in)
Reads two bytes from the InputStream, convertes them to a short and stores them to an int to preserve the sign. |
static short |
readUnsignedByte(java.io.BufferedInputStream in)
Reads one unsigned byte from the InputStream stored in a short-value to preserve the sign. |
static short |
readUnsignedByte(java.io.InputStream in)
Reads one unsigned byte from the InputStream stored in a short-value to preserve the sign. |
static int |
readUnsignedShort(java.io.BufferedInputStream in)
Reads two bytes from the InputStream, convertes them to a short and stores them to an int to preserve the sign. |
static int |
readUnsignedShort(java.io.InputStream in)
Reads two bytes from the InputStream, convertes them to a short and stores them to an int to preserve the sign. |
static void |
skipBytes(java.io.BufferedInputStream in,
long toSkip)
Skips and discards the given number of bytes from the given stream. |
static void |
skipBytes(java.io.InputStream in,
long toSkip)
Skips and discards the given number of bytes from the given stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StreamUtils()
| Method Detail |
|---|
public static final void skipBytes(java.io.InputStream in,
long toSkip)
throws java.io.IOException
in - toSkip -
java.io.IOException
public static final void skipBytes(java.io.BufferedInputStream in,
long toSkip)
throws java.io.IOException
in - toSkip -
java.io.IOException
public static final byte readByte(java.io.InputStream in)
throws java.io.IOException
in -
java.io.IOException
public static final byte readByte(java.io.BufferedInputStream in)
throws java.io.IOException
in -
java.io.IOException
public static final short readUnsignedByte(java.io.InputStream in)
throws java.io.IOException
in -
java.io.IOException
public static final short readUnsignedByte(java.io.BufferedInputStream in)
throws java.io.IOException
in -
java.io.IOException
public static final short readShort(java.io.InputStream in)
throws java.io.IOException
in -
java.io.IOException
public static final short readShort(java.io.BufferedInputStream in)
throws java.io.IOException
in -
java.io.IOException
public static final int readUnsignedShort(java.io.InputStream in)
throws java.io.IOException
in -
java.io.IOException
public static final int readUnsignedShort(java.io.BufferedInputStream in)
throws java.io.IOException
in -
java.io.IOException
public static final short readSwappedShort(java.io.InputStream in)
throws java.io.IOException
in -
java.io.IOException
public static final short readSwappedShort(java.io.BufferedInputStream in)
throws java.io.IOException
in -
java.io.IOException
public static final int readSwappedUnsignedShort(java.io.InputStream in)
throws java.io.IOException
in -
java.io.IOException
public static final int readSwappedUnsignedShort(java.io.BufferedInputStream in)
throws java.io.IOException
in -
java.io.IOException
public static final int readInt(java.io.InputStream in)
throws java.io.IOException
in -
java.io.IOException
public static final int readInt(java.io.BufferedInputStream in)
throws java.io.IOException
in -
java.io.IOException
public static final int readSwappedInt(java.io.InputStream in)
throws java.io.IOException
in -
java.io.IOException
public static final int readSwappedInt(java.io.BufferedInputStream in)
throws java.io.IOException
in -
java.io.IOException
public static final void readBytes(java.io.InputStream in,
int bytesToRead,
byte[] buffer,
int bufferOffset)
throws java.io.IOException
in - bytesToRead - buffer - bufferOffset -
java.io.IOException
public static final void readBytes(java.io.BufferedInputStream in,
int bytesToRead,
byte[] buffer,
int bufferOffset)
throws java.io.IOException
in - bytesToRead - buffer - bufferOffset -
java.io.IOException
public static final java.lang.String readCString(java.io.InputStream in,
int maxLength,
boolean alwaysReadMaxLength)
throws java.io.IOException
in - maxLength - alwaysReadMaxLength -
java.io.IOException
public static final byte[] buildByteArray(java.io.InputStream in,
int initialSize)
throws java.io.IOException
initialSize and is
enlarged on demand.
in - the InputStream to get data frominitialSize - the initial size of the output byte-array
java.io.IOException
public static final byte[] buildByteArray(java.io.InputStream in)
throws java.io.IOException
buildByteArray(InputStream, int) with an initialSize
of in.available().
in - the InputStream to get data from
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||