tobleron said:
Currently I'm starting to write a DICOM file in Java. I've wrote it
before in C, and I used fwrite() command to write byte by byte. What
is the equal command as fwrite() in Java ?
In Java Streams are used instead of the use of (file-)handles
as it is the case in C AFAIR.
java.i

utputStream is already working with byte, so if you
have a ready-to-write block of bytes you can simply do the
following:
FileOutputStream fos = new FileOutputStream(filename);
fos.write(myDataBloc);
fos.close();
You can also write element by element e.g. with DataOutputStream,
but you have to keep in mind that DataOutputStream.writeInt always
writes an int in HSB-order independent from the underlying OS.
So if DICOM is working with LSB-order (I don't know and I will not
check now ;-) you have to create your own byte-array from an int
instead of using that helper-method.
Regards, Lothar
--
Lothar Kimmeringer E-Mail: (e-mail address removed)
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)
Always remember: The answer is forty-two, there can only be wrong
questions!