Create a file in memory [message #569280] |
Sun, 21 December 2008 17:00 |
Eclipse User |
|
|
|
Originally posted by: news.s237965939.online.de
I want to create a file stream in memory. In my case it's a midifile.
This file has a specified format. The header and other blocks have
variables of different types. A byte[] buffer is associated to the
class. My question now is how can I easily write my different variables
sequentially into the buffer? How will the headerChunk.write() function
look like? Here comes a little excerpt.
TIA,
Hans
public class MidiFile extends ByteArrayInputStream {
class headerChunk {
final byte[] Id = { 'M', 'T', 'h', 'd' };
final int Size = 6;
short Format = 0;
short NumTracks = 1;
short TimeDiv;
void write(....); ????
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.04309 seconds