Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Mobile Tools for Java (MTJ) » Create a file in memory
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(....); ????
}
}
Previous Topic:MTJ 0.9.1 RC2 now available for download
Next Topic:Create a file in memory
Goto Forum:
  


Current Time: Wed Jul 30 13:35:42 EDT 2014

Powered by FUDForum. Page generated in 0.08440 seconds