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 short
BIG_ENDIAN
static short
LITTLE_ENDIAN
-
Method Summary
Modifier and Type Method Description static void
close(java.io.InputStream is)
static void
close(java.io.OutputStream os)
static byte[]
inputStreamToByteArray(java.io.InputStream is)
static int
read(java.io.InputStream is)
static int
read(java.io.InputStream is, byte[] bytes)
static int
read(java.io.InputStream is, byte[] bytes, int off, int len)
static double
readDouble(java.io.InputStream is)
static double
readDoubleMM(java.io.InputStream is)
static float
readFloat(java.io.InputStream is)
static float
readFloatMM(java.io.InputStream is)
static void
readFully(java.io.InputStream is, byte[] b)
static void
readFully(java.io.InputStream is, byte[] b, int off, int len)
static byte[]
readFully(java.io.InputStream is, int bufLen)
static int
readInt(byte[] buf, int start_idx)
static int
readInt(java.io.InputStream is)
static int
readIntMM(byte[] buf, int start_idx)
static int
readIntMM(java.io.InputStream is)
static long
readLong(byte[] buf, int start_idx)
static long
readLong(java.io.InputStream is)
static long
readLongMM(byte[] buf, int start_idx)
static long
readLongMM(java.io.InputStream is)
static float
readS15Fixed16MMNumber(byte[] buf, int start_idx)
static float
readS15Fixed16MMNumber(java.io.InputStream is)
static float
readS15Fixed16Number(byte[] buf, int start_idx)
static float
readS15Fixed16Number(java.io.InputStream is)
static short
readShort(byte[] buf, int start_idx)
static short
readShort(java.io.InputStream is)
static short
readShortMM(byte[] buf, int start_idx)
static short
readShortMM(java.io.InputStream is)
static long
readUnsignedInt(byte[] buf, int start_idx)
static long
readUnsignedInt(java.io.InputStream is)
static long
readUnsignedIntMM(byte[] buf, int start_idx)
static long
readUnsignedIntMM(java.io.InputStream is)
static int
readUnsignedShort(byte[] buf, int start_idx)
static int
readUnsignedShort(java.io.InputStream is)
static int
readUnsignedShortMM(byte[] buf, int start_idx)
static int
readUnsignedShortMM(java.io.InputStream is)
static long
skip(java.io.InputStream is, long len)
static void
skipFully(java.io.InputStream is, int n)
static void
write(java.io.OutputStream os, byte[] bytes)
static void
write(java.io.OutputStream os, byte[] bytes, int off, int len)
static void
write(java.io.OutputStream os, int abyte)
static void
writeInt(java.io.OutputStream os, int value)
static void
writeIntMM(java.io.OutputStream os, int value)
static void
writeLong(java.io.OutputStream os, long value)
static void
writeLongMM(java.io.OutputStream os, long value)
static void
writeShort(java.io.OutputStream os, int value)
static void
writeShortMM(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
-