• Post Reply Bookmark Topic Watch Topic
  • New Topic

binary file with group of data (like structure in C)

 
Nikes Shah
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is there any way to create binary file using Java with group of data (structure in C).

Our requirement is to create binary file which can be read using C as a structure.

Thanks for any information.
 
Greg Charles
Sheriff
Posts: 3010
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, of course, you can use Java to create files with any contents you want them to have. Use a FileOutputStream, and just write out the bytes you want the file to have. Now, if you're trying to automatically stream out Java objects so that C can work with them, that's a more interesting issue. Is that what you want to do?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!