File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes dataoutputstream and outputstreamwriter class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "dataoutputstream and outputstreamwriter class" Watch "dataoutputstream and outputstreamwriter class" New topic
Author

dataoutputstream and outputstreamwriter class

nagul samy
Ranch Hand

Joined: Feb 15, 2012
Posts: 37
what is the difference between dataoutputstream and outputstreamwriter class in java ??? are both used for converting characters into bytes ???
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7892
    
  21

nagul samy wrote:what is the difference between dataoutputstream and outputstreamwriter class in java ??? are both used for converting characters into bytes ???

The API docs are quite clear about what each class does. What exactly is it you don't understand?

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14192
    
  20

Java has two kinds of I/O interfaces and classes: streams and readers/writers.

Streams (everything that implements InputStream or OutputStream) are for reading and writing binary data.

Readers and writers are a layer on top of streams for reading and writing text (characters). Readers and writers convert binary data from and to characters using a character encoding.

DataOutputStream is for writing Java objects and values to an underlying OutputStream in binary format. OutputStreamWriter is a writer, for writing text, to an underlying OutputStream.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
wood burning stoves
 
subject: dataoutputstream and outputstreamwriter class