I am making a Java application that uses HTK recognition.

I need Java to create feature files in HTK format from
certain data that the program handles. So, I need from
Java to create new files and add data to them. I have
a MatLab function that does this I want:

function escribeHTK(file,d,fp,tc)

fid = fopen(file,'w','b');
[nf,nv] = size(d);
fwrite(fid,nf,'long'); % write frame count
fwrite(fid,round(fp*1.E7),'long'); % write frame period (in 100 ns units)
nby = nv * 4;
fwrite(fid,nby,'short'); % write byte count
fwrite(fid,tc,'short'); % write type code
fwrite(fid,d.','float'); % write data array

But I need to do that in Java. The function above generates
a file whose data format is IEEE754 floating-point big-endian.
Then, the function adds a header and append the features, where
every variable has its own precission.

I have tried to deploy the function above in Java defining
every variable correspondingly (short, long...) and after,
writing in an output stream the header and features using
the method "floatToIntBits" from "Float" class. This
did not work because HTk does not recognize the resulting files
(as if the file does not have the correct format).

I do not want to use MatLab Builder JA so, what can I do?
Anybody knows how can I deploy it?

Thanks a lot.