|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groovemanager.sampled.providers.WaveChunk
Wave files can contain additional information besides the audio data
organized in chunks. This class provides support for such a chunk.
A chunk is organized in the following way:
- The first 4 bytes contain an ASCII-String identifying the chunk type,
called chunk ID.
- The next 4 bytes contain an Integer describing the length of the following
data in bytes.
- The format of the following data is specific to each chunk type
| Field Summary | |
|---|---|
protected java.nio.ByteBuffer |
chunkData
The chunk data without the chunk ID and the length |
protected java.lang.String |
chunkname
The Chunk ID (length 4) |
| Constructor Summary | |
|---|---|
WaveChunk(byte[] wholeChunk)
Construct a new WaveChunk |
|
WaveChunk(java.lang.String name,
byte[] data)
Construct a new WaveChunk |
|
WaveChunk(java.lang.String name,
int length)
Construct a new empty WaveChunk |
|
| Method Summary | |
|---|---|
byte[] |
getData()
Get the chunk data not including the chunk ID and the chunk length |
int |
getLength()
Get the chunk length |
java.lang.String |
getName()
Get the Chunk ID |
int |
writeToOut(java.io.OutputStream out)
Write this chunk to an OutputStream |
int |
writeToOut(java.io.RandomAccessFile out)
Write this chunk to a RandomAccessFile |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.nio.ByteBuffer chunkData
protected java.lang.String chunkname
| Constructor Detail |
|---|
public WaveChunk(byte[] wholeChunk)
wholeChunk - The chunk data including the chunk ID (first 4 bytes)
and the chunk length (next 4 bytes)
public WaveChunk(java.lang.String name,
byte[] data)
name - The chunk ID (will be filled up or shortened to length 4)data - The chunk data without the chunk ID and the length
public WaveChunk(java.lang.String name,
int length)
name - The chunk ID (will be filled up or shortened to length 4)length - The length of the chunk data| Method Detail |
|---|
public byte[] getData()
public int getLength()
public java.lang.String getName()
public int writeToOut(java.io.OutputStream out)
throws java.io.IOException
out - The OutputStream to write to
java.io.IOException - IF an I/O Error occured during the write operation
public int writeToOut(java.io.RandomAccessFile out)
throws java.io.IOException
out - The OutputStream to write to
java.io.IOException - IF an I/O Error occured during the write operation
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||