This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java/input-output stream

 
karthi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
difference between buffered input stream and data input stream
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both are higher level input streams and can be created to add functionality to another InputStream. (Including each other)
DataInputStream allows you to read the data off the inputstream as Java types including int, double, byte, byte[]. It does have a method to read in a String but, it's deprecated in favor of readLine in the BufferedInputStream.
BufferedInputStream buffers the input (reads ahead basically) and when you make a read off the stream, you are actually reading it off the buffer. This provides a performance enhancement to your Input operations.
Hope this helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic