• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Converting text file to binary

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
It looks like it's time for me to write you a reality check! Or maybe a tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic