tags:

views:

97

answers:

1

I need to write multiple blocks of the following chunk into a file

+----------+--------------+---------------------+
| FileName | Size of File | Binary Dump Of File |
+----------+--------------+---------------------+

There are two variants of file writers I could see. 1. FileWriter - allows writing [string,char[],one byte] 2. BufferFileoutputStream - allows writing [byte array]

I need an File object that can write String,Integer and binary data. But I could not find any direct way out. We can definitely have work-arounds, like converting Strings and Integers to byte array. But is there a better alternative ??

A: 

Yes there is an alternative. It is called: java.io.DataOutputStream. To know if it is helpful to your problem we would need more informations.

Martin
Thanks a lot. This what I wanted