com.imagero.uio.io
Class IOutils

java.lang.Object
  extended bycom.imagero.uio.io.IOutils

public class IOutils
extends java.lang.Object

IOutils.java


Constructor Summary
IOutils()
           
 
Method Summary
static void closeStream(java.io.BufferedReader br)
          close silently stream
no exception it thrown
static void closeStream(java.io.BufferedWriter bw)
          close silently stream
no exception it thrown
static void closeStream(java.io.InputStream is)
          close silently stream
no exception it thrown
static void closeStream(java.io.OutputStream os)
          close silently stream
no exception it thrown
static void closeStream(java.io.RandomAccessFile raf)
          close silently stream
no exception it thrown
static void closeStream(RandomAccessRO ro)
          close silently stream
no exception it thrown
static java.lang.String getExtension(java.io.File f)
           
static void printHexByte(int value)
           
static void printHexInt(int value)
           
static void printHexLong(long value)
           
static void printHexShort(int value)
           
static void printlnHexByte(int value)
           
static void printlnHexInt(int value)
           
static void printlnHexLong(long value)
           
static void printlnHexShort(int value)
           
static void readFully(java.io.InputStream in, byte[] b)
           
static void readFully(java.io.InputStream in, byte[] b, int off, int len)
           
static int readFully2(java.io.InputStream in, byte[] b)
          this method is like readFully, but instead of throwing EOFException it returns count of read bytes
static int readFully2(java.io.InputStream in, byte[] b, int off, int len)
          this method is like readFully, but instead of throwing EOFException it returns count of read bytes
static void readFullyS(RandomAccessRO ro, byte[] b0)
          Read byte array and convert from 2's complement
static void readFullyS(RandomAccessRO ro, int[] b0)
          Read int array and convert from 2's complement
static void readFullyS(RandomAccessRO ro, long[] b0)
          Read short array and convert from 2's complement
static void readFullyS(RandomAccessRO ro, short[] b0)
          Read short array and convert from 2's complement.
static int readInt49(java.io.InputStream in)
          read big-endian int
static int readInt49(java.io.RandomAccessFile in)
          read big-endian int
static int readInt49(RandomAccessRO in)
          read big-endian int
static int readInt4D(java.io.InputStream in)
          read little-endian int
static int readInt4D(java.io.RandomAccessFile in)
          read little-endian int
static int readInt4D(RandomAccessRO in)
          read little-endian int
static long readLong49(java.io.InputStream in)
          read big-endian long
static long readLong49(java.io.RandomAccessFile in)
          read big-endian long
static long readLong49(RandomAccessRO in)
          read big-endian long
static long readLong4D(java.io.InputStream in)
          read little-endian long
static long readLong4D(java.io.RandomAccessFile in)
          read little-endian long
static long readLong4D(RandomAccessRO in)
          read little-endian long
static byte readSByte(RandomAccessRO ro)
           
static int readShort49(java.io.InputStream in)
          read big-endian short
static int readShort49(java.io.RandomAccessFile in)
          read big-endian short
static int readShort49(RandomAccessRO in)
          read big-endian short
static int readShort4D(java.io.InputStream in)
          read little-endian short
static int readShort4D(java.io.RandomAccessFile in)
          read little-endian short
static int readShort4D(RandomAccessRO in)
          read little-endian short
static int readSInt(RandomAccessRO ro)
           
static long readSLong(RandomAccessRO ro)
           
static short readSShort(RandomAccessRO ro)
           
static java.lang.String toBinaryString(byte value)
           
static java.lang.String toBinaryString(char value)
           
static java.lang.String toBinaryString(int value, int length)
           
static java.lang.String toHexString(byte value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOutils

public IOutils()
Method Detail

closeStream

public static void closeStream(java.io.BufferedWriter bw)
close silently stream
no exception it thrown

Parameters:
bw -

closeStream

public static void closeStream(java.io.BufferedReader br)
close silently stream
no exception it thrown

Parameters:
br -

closeStream

public static void closeStream(java.io.InputStream is)
close silently stream
no exception it thrown

Parameters:
is -

closeStream

public static void closeStream(java.io.OutputStream os)
close silently stream
no exception it thrown

Parameters:
os -

closeStream

public static void closeStream(java.io.RandomAccessFile raf)
close silently stream
no exception it thrown

Parameters:
raf -

closeStream

public static void closeStream(RandomAccessRO ro)
close silently stream
no exception it thrown

Parameters:
ro -

toBinaryString

public static java.lang.String toBinaryString(byte value)

toBinaryString

public static java.lang.String toBinaryString(char value)

toBinaryString

public static java.lang.String toBinaryString(int value,
                                              int length)

toHexString

public static java.lang.String toHexString(byte value)

printHexByte

public static void printHexByte(int value)

printlnHexByte

public static void printlnHexByte(int value)

printHexShort

public static void printHexShort(int value)

printlnHexShort

public static void printlnHexShort(int value)

printHexInt

public static void printHexInt(int value)

printlnHexInt

public static void printlnHexInt(int value)

printHexLong

public static void printHexLong(long value)

printlnHexLong

public static void printlnHexLong(long value)

getExtension

public static java.lang.String getExtension(java.io.File f)

readShort4D

public static int readShort4D(java.io.InputStream in)
                       throws java.io.IOException
read little-endian short

Throws:
java.io.IOException

readShort4D

public static int readShort4D(java.io.RandomAccessFile in)
                       throws java.io.IOException
read little-endian short

Throws:
java.io.IOException

readShort4D

public static int readShort4D(RandomAccessRO in)
                       throws java.io.IOException
read little-endian short

Throws:
java.io.IOException

readShort49

public static int readShort49(java.io.InputStream in)
                       throws java.io.IOException
read big-endian short

Throws:
java.io.IOException

readShort49

public static int readShort49(java.io.RandomAccessFile in)
                       throws java.io.IOException
read big-endian short

Throws:
java.io.IOException

readShort49

public static int readShort49(RandomAccessRO in)
                       throws java.io.IOException
read big-endian short

Throws:
java.io.IOException

readInt4D

public static int readInt4D(java.io.InputStream in)
                     throws java.io.IOException
read little-endian int

Throws:
java.io.IOException

readInt4D

public static int readInt4D(java.io.RandomAccessFile in)
                     throws java.io.IOException
read little-endian int

Throws:
java.io.IOException

readInt4D

public static int readInt4D(RandomAccessRO in)
                     throws java.io.IOException
read little-endian int

Throws:
java.io.IOException

readInt49

public static int readInt49(java.io.InputStream in)
                     throws java.io.IOException
read big-endian int

Throws:
java.io.IOException

readInt49

public static int readInt49(java.io.RandomAccessFile in)
                     throws java.io.IOException
read big-endian int

Throws:
java.io.IOException

readInt49

public static int readInt49(RandomAccessRO in)
                     throws java.io.IOException
read big-endian int

Throws:
java.io.IOException

readLong4D

public static long readLong4D(java.io.InputStream in)
                       throws java.io.IOException
read little-endian long

Throws:
java.io.IOException

readLong4D

public static long readLong4D(java.io.RandomAccessFile in)
                       throws java.io.IOException
read little-endian long

Throws:
java.io.IOException

readLong4D

public static long readLong4D(RandomAccessRO in)
                       throws java.io.IOException
read little-endian long

Throws:
java.io.IOException

readLong49

public static long readLong49(java.io.InputStream in)
                       throws java.io.IOException
read big-endian long

Throws:
java.io.IOException

readLong49

public static long readLong49(java.io.RandomAccessFile in)
                       throws java.io.IOException
read big-endian long

Throws:
java.io.IOException

readLong49

public static long readLong49(RandomAccessRO in)
                       throws java.io.IOException
read big-endian long

Throws:
java.io.IOException

readSByte

public static byte readSByte(RandomAccessRO ro)
                      throws java.io.IOException
Throws:
java.io.IOException

readSShort

public static short readSShort(RandomAccessRO ro)
                        throws java.io.IOException
Throws:
java.io.IOException

readSInt

public static int readSInt(RandomAccessRO ro)
                    throws java.io.IOException
Throws:
java.io.IOException

readSLong

public static long readSLong(RandomAccessRO ro)
                      throws java.io.IOException
Throws:
java.io.IOException

readFullyS

public static void readFullyS(RandomAccessRO ro,
                              byte[] b0)
                       throws java.io.IOException
Read byte array and convert from 2's complement

Parameters:
ro - RandomAccessRO
b0 - byte array
Throws:
java.io.IOException

readFullyS

public static void readFullyS(RandomAccessRO ro,
                              short[] b0)
                       throws java.io.IOException
Read short array and convert from 2's complement.

Parameters:
ro - RandomAccessRO
b0 - short array
Throws:
java.io.IOException

readFullyS

public static void readFullyS(RandomAccessRO ro,
                              int[] b0)
                       throws java.io.IOException
Read int array and convert from 2's complement

Parameters:
ro - RandomAccessRO
b0 - int array
Throws:
java.io.IOException

readFullyS

public static void readFullyS(RandomAccessRO ro,
                              long[] b0)
                       throws java.io.IOException
Read short array and convert from 2's complement

Parameters:
ro - RandomAccessRO
b0 - long array
Throws:
java.io.IOException

readFully

public static void readFully(java.io.InputStream in,
                             byte[] b)
                      throws java.io.IOException
Throws:
java.io.IOException

readFully

public static void readFully(java.io.InputStream in,
                             byte[] b,
                             int off,
                             int len)
                      throws java.io.IOException
Throws:
java.io.IOException

readFully2

public static int readFully2(java.io.InputStream in,
                             byte[] b)
                      throws java.io.IOException
this method is like readFully, but instead of throwing EOFException it returns count of read bytes

Parameters:
in - InputStream to read
b - byte array to fill
Returns:
number of bytes read into the buffer, or -1 if EOF was reached
Throws:
java.io.IOException

readFully2

public static int readFully2(java.io.InputStream in,
                             byte[] b,
                             int off,
                             int len)
                      throws java.io.IOException
this method is like readFully, but instead of throwing EOFException it returns count of read bytes

Parameters:
in - InputStream to read
b - byte array to fill
off - start offset in byte array
len - number of bytes to read
Returns:
number of bytes read into the buffer, or -1 if EOF was reached
Throws:
java.io.IOException