Package pixy.io
Class IOUtils
java.lang.Object
pixy.io.IOUtils
public class IOUtils
extends java.lang.Object
General purpose IO helper class
- Version:
- 1.0 10/12/2012
- Author:
- Wen Yu, yuwen_66@yahoo.com
-
Field Summary
Fields Modifier and Type Field Description static shortBIG_ENDIANstatic shortLITTLE_ENDIAN -
Method Summary
Modifier and Type Method Description static voidclose(java.io.InputStream is)static voidclose(java.io.OutputStream os)static byte[]inputStreamToByteArray(java.io.InputStream is)static intread(java.io.InputStream is)static intread(java.io.InputStream is, byte[] bytes)static intread(java.io.InputStream is, byte[] bytes, int off, int len)static doublereadDouble(java.io.InputStream is)static doublereadDoubleMM(java.io.InputStream is)static floatreadFloat(java.io.InputStream is)static floatreadFloatMM(java.io.InputStream is)static voidreadFully(java.io.InputStream is, byte[] b)static voidreadFully(java.io.InputStream is, byte[] b, int off, int len)static byte[]readFully(java.io.InputStream is, int bufLen)static intreadInt(byte[] buf, int start_idx)static intreadInt(java.io.InputStream is)static intreadIntMM(byte[] buf, int start_idx)static intreadIntMM(java.io.InputStream is)static longreadLong(byte[] buf, int start_idx)static longreadLong(java.io.InputStream is)static longreadLongMM(byte[] buf, int start_idx)static longreadLongMM(java.io.InputStream is)static floatreadS15Fixed16MMNumber(byte[] buf, int start_idx)static floatreadS15Fixed16MMNumber(java.io.InputStream is)static floatreadS15Fixed16Number(byte[] buf, int start_idx)static floatreadS15Fixed16Number(java.io.InputStream is)static shortreadShort(byte[] buf, int start_idx)static shortreadShort(java.io.InputStream is)static shortreadShortMM(byte[] buf, int start_idx)static shortreadShortMM(java.io.InputStream is)static longreadUnsignedInt(byte[] buf, int start_idx)static longreadUnsignedInt(java.io.InputStream is)static longreadUnsignedIntMM(byte[] buf, int start_idx)static longreadUnsignedIntMM(java.io.InputStream is)static intreadUnsignedShort(byte[] buf, int start_idx)static intreadUnsignedShort(java.io.InputStream is)static intreadUnsignedShortMM(byte[] buf, int start_idx)static intreadUnsignedShortMM(java.io.InputStream is)static longskip(java.io.InputStream is, long len)static voidskipFully(java.io.InputStream is, int n)static voidwrite(java.io.OutputStream os, byte[] bytes)static voidwrite(java.io.OutputStream os, byte[] bytes, int off, int len)static voidwrite(java.io.OutputStream os, int abyte)static voidwriteInt(java.io.OutputStream os, int value)static voidwriteIntMM(java.io.OutputStream os, int value)static voidwriteLong(java.io.OutputStream os, long value)static voidwriteLongMM(java.io.OutputStream os, long value)static voidwriteShort(java.io.OutputStream os, int value)static voidwriteShortMM(java.io.OutputStream os, int value)
-
Field Details
-
LITTLE_ENDIAN
public static final short LITTLE_ENDIAN- See Also:
- Constant Field Values
-
BIG_ENDIAN
public static final short BIG_ENDIAN- See Also:
- Constant Field Values
-
-
Method Details
-
close
public static void close(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
close
public static void close(java.io.OutputStream os) throws java.io.IOException- Throws:
java.io.IOException
-
inputStreamToByteArray
public static byte[] inputStreamToByteArray(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
read
public static int read(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
read
public static int read(java.io.InputStream is, byte[] bytes) throws java.io.IOException- Throws:
java.io.IOException
-
read
public static int read(java.io.InputStream is, byte[] bytes, int off, int len) throws java.io.IOException- Throws:
java.io.IOException
-
readDouble
public static double readDouble(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readDoubleMM
public static double readDoubleMM(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readFloat
public static float readFloat(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readFloatMM
public static float readFloatMM(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readFully
public static byte[] readFully(java.io.InputStream is, int bufLen) throws java.io.IOException- Throws:
java.io.IOException
-
readFully
public static void readFully(java.io.InputStream is, byte[] b) throws java.io.IOException- Throws:
java.io.IOException
-
readFully
public static void readFully(java.io.InputStream is, byte[] b, int off, int len) throws java.io.IOException- Throws:
java.io.IOException
-
readInt
public static int readInt(byte[] buf, int start_idx) -
readInt
public static int readInt(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readIntMM
public static int readIntMM(byte[] buf, int start_idx) -
readIntMM
public static int readIntMM(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readLong
public static long readLong(byte[] buf, int start_idx) -
readLong
public static long readLong(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readLongMM
public static long readLongMM(byte[] buf, int start_idx) -
readLongMM
public static long readLongMM(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readS15Fixed16MMNumber
public static float readS15Fixed16MMNumber(byte[] buf, int start_idx) -
readS15Fixed16MMNumber
public static float readS15Fixed16MMNumber(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readS15Fixed16Number
public static float readS15Fixed16Number(byte[] buf, int start_idx) -
readS15Fixed16Number
public static float readS15Fixed16Number(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readShort
public static short readShort(byte[] buf, int start_idx) -
readShort
public static short readShort(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readShortMM
public static short readShortMM(byte[] buf, int start_idx) -
readShortMM
public static short readShortMM(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readUnsignedInt
public static long readUnsignedInt(byte[] buf, int start_idx) -
readUnsignedInt
public static long readUnsignedInt(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readUnsignedIntMM
public static long readUnsignedIntMM(byte[] buf, int start_idx) -
readUnsignedIntMM
public static long readUnsignedIntMM(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readUnsignedShort
public static int readUnsignedShort(byte[] buf, int start_idx) -
readUnsignedShort
public static int readUnsignedShort(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readUnsignedShortMM
public static int readUnsignedShortMM(byte[] buf, int start_idx) -
readUnsignedShortMM
public static int readUnsignedShortMM(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
skip
public static long skip(java.io.InputStream is, long len) throws java.io.IOException- Throws:
java.io.IOException
-
skipFully
public static void skipFully(java.io.InputStream is, int n) throws java.io.IOException- Throws:
java.io.IOException
-
write
public static void write(java.io.OutputStream os, byte[] bytes) throws java.io.IOException- Throws:
java.io.IOException
-
write
public static void write(java.io.OutputStream os, byte[] bytes, int off, int len) throws java.io.IOException- Throws:
java.io.IOException
-
write
public static void write(java.io.OutputStream os, int abyte) throws java.io.IOException- Throws:
java.io.IOException
-
writeInt
public static void writeInt(java.io.OutputStream os, int value) throws java.io.IOException- Throws:
java.io.IOException
-
writeIntMM
public static void writeIntMM(java.io.OutputStream os, int value) throws java.io.IOException- Throws:
java.io.IOException
-
writeLong
public static void writeLong(java.io.OutputStream os, long value) throws java.io.IOException- Throws:
java.io.IOException
-
writeLongMM
public static void writeLongMM(java.io.OutputStream os, long value) throws java.io.IOException- Throws:
java.io.IOException
-
writeShort
public static void writeShort(java.io.OutputStream os, int value) throws java.io.IOException- Throws:
java.io.IOException
-
writeShortMM
public static void writeShortMM(java.io.OutputStream os, int value) throws java.io.IOException- Throws:
java.io.IOException
-