com.petersalomonsen.jjack.javasound
Class ByteIntConverter
java.lang.Object
com.petersalomonsen.jjack.javasound.ByteIntConverter
public final class ByteIntConverter
- extends java.lang.Object
Convert 8,16,24 and 32 bit integers (stored as bytes) to and from integer variables
- Version:
- 0.3
- Author:
- Peter Johan Salomonsen
Constructor Summary |
ByteIntConverter(int bytesPerSample,
boolean bigEndian,
boolean signed)
|
Method Summary |
int |
readInt(byte[] bytes,
int index)
Read from the byte array into an integer |
void |
writeInt(byte[] bytes,
int index,
int value)
Write an integer into the byte array |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
bytesPerSample
final int bytesPerSample
- Use final for inline optimization
bigEndian
final boolean bigEndian
signed
final boolean signed
msbIndex
final int msbIndex
ByteIntConverter
public ByteIntConverter(int bytesPerSample,
boolean bigEndian,
boolean signed)
readInt
public final int readInt(byte[] bytes,
int index)
- Read from the byte array into an integer
writeInt
public final void writeInt(byte[] bytes,
int index,
int value)
- Write an integer into the byte array