|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gausssoft.io.IOUtils
This class holds a series of useful methods relating to IO functions.
IOConstants
Fields inherited from interface gausssoft.io.IOConstants |
NULLOUT |
Method Summary | |
static void |
argCheck(byte[] b,
int off,
int len)
Utility method to check for valid parameters for any kind of array read or write operation. |
static void |
argCircularCheck(byte[] b,
int off,
int len)
Utility method to check for valid parameters for any kind of circular array read or write operation. |
static void |
argIndexCheck(byte[] b,
int index)
Utility method to check that a byte array is not null, and the index variable is a valid index in the array. |
static boolean |
isSerializable(Object obj)
Returns true if this object could be written to an
ObjectOutputStream without throwing a NotSerializableException . |
static void |
writeCircularArray(OutputStream out,
byte[] b,
int off,
int len)
Utility method that will write a series of bytes in an array to an OutputStream , which are
stored in the array in a circular manner. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void argIndexCheck(byte[] b, int index)
The method will return normally if nothing is incorrect, otherwise it will throw the relevant exception.
b
- The byte array to check.index
- The index position to check.NullPointerException
- If b
is null
.IndexOutOfBoundsException
- If index
is invalid.public static void argCircularCheck(byte[] b, int off, int len)
If the method returns normally, it will ensure that:
NullPointerException
will be thrown).
IndexOutOfBoundsException
will be thrown).
IllegalArgumentException
will be thrown).
IndexOutOfBoundsException
will be thrown).
b
- The byte array to check.off
- The index position where the operation will begin.len
- The number of bytes in the array to be processed.NullPointerException
- If b
is null
.IllegalArgumentException
- If len
is less than 0.IndexOutOfBoundsException
- If off
is invalid, or if len
is longer than
the size of the array.public static void argCheck(byte[] b, int off, int len)
If the method returns normally, it will ensure that:
NullPointerException
will be thrown).
IndexOutOfBoundsException
will be thrown).
IllegalArgumentException
will be thrown).
IndexOutOfBoundsException
will be thrown).
b
- The byte array to check.off
- The index position where the operation will begin.len
- The number of bytes in the array to be processed.NullPointerException
- If b
is null
.IllegalArgumentException
- If len
is less than 0.IndexOutOfBoundsException
- If off
is invalid, or if off + len
is an invalid index position.public static void writeCircularArray(OutputStream out, byte[] b, int off, int len) throws IOException
OutputStream
, which are
stored in the array in a circular manner. This method can also be used for writing an array which isn't circular into a stream.
out
- The OutputStream to write to.b
- The circular byte array to write to the stream.off
- The index position of the first data byte.len
- The number of bytes to write into the stream.NullPointerException
- If b
or out
is null
.IllegalArgumentException
- If len
is less than 0.IndexOutOfBoundsException
- If off
is invalid, or if len
is larger than
the length of the array.IOException
- If there was a problem writing the array.public static boolean isSerializable(Object obj)
true
if this object could be written to an
ObjectOutputStream
without throwing a NotSerializableException
.obj
- The object to test.true
if this object can be written to an ObjectOutputStream safely.Serializable
,
ObjectOutputStream
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |