|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmediautil.gen.BasicIo
public class BasicIo
This is a utility class containing io and other general methods. This is mainly for use by other MediaUtil classes but may also be useful otherwise.
| Field Summary | |
|---|---|
static String[] |
FACTOR_ABVS
|
| Constructor Summary | |
|---|---|
BasicIo()
|
|
| Method Summary | |
|---|---|
static int |
asInt(String str)
|
static String |
asString(int i)
|
static void |
bn2s(byte[] result,
int offset,
int value,
int length)
Converts the passed int value to bytes of Motorola Type (byte[0] is LSB) |
static byte[] |
bn2s(int value,
int length)
Converts the passed int value to bytes of Motorola Type (byte[0] is LSB) |
static String |
convertLength(long l)
|
static void |
in2s(byte[] result,
int offset,
int value,
int length)
Converts the passed int value to bytes of Intel Type (byte[0] is MSB) |
static boolean |
isSignature(byte[] markerData,
int offset,
String signature)
Checks if the bytes in markerData match the signature String. |
static int |
read(InputStream is,
byte[] data)
Definitely Reads data.length bytes unless End of Stream is reached. |
static int |
read(InputStream is,
byte[] b,
int off,
int minBytes,
int n)
Attempts to read n bytes and definitely reads minBytes. |
static int |
s2n(byte[] buf,
int offset,
int length,
boolean signed,
boolean intel)
Converts bytes to a number |
static long |
skip(InputStream is,
long n)
Definitely Skips n bytes unless End of Stream is reached. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String[] FACTOR_ABVS
| Constructor Detail |
|---|
public BasicIo()
| Method Detail |
|---|
public static int s2n(byte[] buf,
int offset,
int length,
boolean signed,
boolean intel)
buf - Bytes to convertoffset - Start offset of byteslength - Length of bytes to convertsigned - If signedintel - Specifies If data is of intel type (buf[0] is Most
Significant Byte). If false then data is of Motorola Type (buf[0] is
LSB)
public static void in2s(byte[] result,
int offset,
int value,
int length)
result - Output bytesoffset - Start offset to store the resultvalue - Value to convertlength - Length of bytes required
public static void bn2s(byte[] result,
int offset,
int value,
int length)
result - Output bytesoffset - Start offset to store the resultvalue - Value to convertlength - Length of bytes required
public static byte[] bn2s(int value,
int length)
value - Value to convertlength - Length of bytes required
public static boolean isSignature(byte[] markerData,
int offset,
String signature)
markerData - Marker Dataoffset - Start offset of bytessignature - Signature String. All the characters in this String are
compared with the bytes starting from offset
public static long skip(InputStream is,
long n)
throws IOException
is - Input Streamn - Number bytes to skip
IOException
public static int read(InputStream is,
byte[] b,
int off,
int minBytes,
int n)
throws IOException
is - Input Streamb - Byte Array to read intooff - Offset to store data fromminBytes - Minimum bytes to readn - Number of bytes to try to read
IOException - If n < 0 or if
minBytes > n or if is.read(..) throws and
Exception.
public static int read(InputStream is,
byte[] data)
throws IOException
is - Input Streamdata - Byte array to read to
IOExceptionpublic static String convertLength(long l)
public static int asInt(String str)
public static String asString(int i)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||