Skip to main content



      Home
Home » Archived » 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 UserFriend
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: Sun Jul 06 19:46:03 EDT 2025

Powered by FUDForum. Page generated in 0.04309 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top