• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

DataInputStream  RSS feed

 
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

the DataInputStream and
DataOutputStream classes are high - level streams that contain methods for reading and writing
the eight Java primitive types as well as String objects




When I deal with a file, I save text there, and read it somewhere.

only text.As C or PHP

What is the usage of save as "primitive types"?

May you show by an example?

 
author
Sheriff
Posts: 23588
138
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

abalfazl hossein wrote:
When I deal with a file, I save text there, and read it somewhere.

only text.As C or PHP

What is the usage of save as "primitive types"?



Not all files need to be text files. It is perfectly valid to save integers, floats, doubles, etc. to a binary file, in their native representation.

Now, of course, if you only believe in using text files, then these methods probably won't ever be used by you.

Henry
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!