com.icdif.audio.io
Class EndianDataInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.DataInputStream
              extended by com.icdif.audio.io.EndianDataInputStream
All Implemented Interfaces:
java.io.Closeable, java.io.DataInput

public class EndianDataInputStream
extends java.io.DataInputStream

This class provides ways of reading the bytes of the PCM Converting them to String, Short or Integer

Author:
wanderer

Constructor Summary
EndianDataInputStream(java.io.InputStream stream)
           
 
Method Summary
 int readInt24Bit()
           
 int readInt24BitLittleEndian()
           
 int readIntLittleEndian()
          Reads an array of 4 bytes and converts it to an integer
 short readShortLittleEndian()
          Reads an array of 2 bytes and converts it to a short
 java.lang.String readStringFrom4Byte()
          Reads an array of 4 bytes as a string - it's useful for reading the wave metadata
 
Methods inherited from class java.io.DataInputStream
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EndianDataInputStream

public EndianDataInputStream(java.io.InputStream stream)
Method Detail

readStringFrom4Byte

public java.lang.String readStringFrom4Byte()
                                     throws java.lang.Exception
Reads an array of 4 bytes as a string - it's useful for reading the wave metadata

Returns:
the String converted from the 4 bytes
Throws:
java.lang.Exception

readShortLittleEndian

public short readShortLittleEndian()
                            throws java.lang.Exception
Reads an array of 2 bytes and converts it to a short

Returns:
The short converted from the array of 2 bytes
Throws:
java.lang.Exception

readIntLittleEndian

public int readIntLittleEndian()
                        throws java.lang.Exception
Reads an array of 4 bytes and converts it to an integer

Returns:
The integer, converted from the array of 4 bytes
Throws:
java.lang.Exception

readInt24BitLittleEndian

public int readInt24BitLittleEndian()
                             throws java.lang.Exception
Returns:
Throws:
java.lang.Exception

readInt24Bit

public int readInt24Bit()
                 throws java.lang.Exception
Returns:
Throws:
java.lang.Exception