• Post Reply Bookmark Topic Watch Topic
  • New Topic

Converting text file to binary

 
Josh Stevens
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to convert a text file into a binary file. The text file has a format like this where "-Student" is the flag in one line:
-Student
Tom 100
-String
This is an example of a text file
-Student
John 99

thanks
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Josh,

Welcome to JavaRanch!

You haven't really given enough information to get a quality response but I'll have a go. I'm assuming that the "student" entries are supposed to be objects. It looks to me like you want to read in the text file, create Java objects from the entries that you find and then look at using java.io.ObjectOutputStream to serialize them to a file.

By the way, if you're expecting people here to do your homework for you you're gonna be disappointed. We're happy to help, however.

Hope that helps.

Jules
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!