what is the different between byte stream and character stream?

Discussion in 'Java' started by dolphin, Mar 17, 2007.

  1. dolphin

    dolphin Guest

    Hi !what is the different between byte stream and character stream?
    dolphin, Mar 17, 2007
    #1
    1. Advertising

  2. dolphin wrote:
    > Hi !what is the different between byte stream and character stream?
    >

    Read the javadocs for java.io.InputStream, java.io.Reader, and probably
    the package for java.io as well.
    Joshua Cranmer, Mar 17, 2007
    #2
    1. Advertising

  3. dolphin wrote on 17.03.2007 14:37:
    > Hi !what is the different between byte stream and character stream?
    >

    A byte stream is for bytes (raw data) and a character stream is for character
    data. As simple as that.

    Your questions seems to indicate that you think a byte and a character is the
    same. It is not.
    Thomas Kellerer, Mar 17, 2007
    #3
  4. dolphin

    Lew Guest

    Thomas Kellerer wrote:
    > dolphin wrote on 17.03.2007 14:37:
    >> Hi !what is the different between byte stream and character stream?
    >>

    > A byte stream is for bytes (raw data) and a character stream is for character
    > data. As simple as that.
    >
    > Your questions seems to indicate that you think a byte and a character is the
    > same. It is not.


    There is also Object{Input|Output}Stream which is for Objects, ...

    When you get into java.nio you have Buffer and its type-specific descendants.

    -- Lew
    Lew, Mar 17, 2007
    #4
  5. dolphin

    Mark Space Guest

    dolphin wrote:
    > Hi !what is the different between byte stream and character stream?
    >


    A byte stream is just that -- raw bytes.

    A character stream is for a given character set. It could be fixed
    width characters (one or two bytes) or some form of variable width like
    UTF-8. I think Java uses variable width internally, but it has readers
    for many different character streams built into the IO subsystem.
    Mark Space, Mar 17, 2007
    #5
  6. dolphin

    Guest

    On Mar 17, 5:37 pm, "dolphin" <> wrote:
    > Hi !what is the different between byte stream and character stream?
    , Mar 18, 2007
    #6
  7. Thomas Kellerer schrieb:

    > dolphin wrote on 17.03.2007 14:37:
    >
    >>Hi !what is the different between byte stream and character stream?
    >>

    >
    > A byte stream is for bytes (raw data) and a character stream is for character
    > data. As simple as that.
    >
    > Your questions seems to indicate that you think a byte and a character is the
    > same. It is not.
    >

    Additional note to the OP:
    a byte is of range [-128...127], a character is of range [0...65535].

    --
    Thomas
    Thomas Fritsch, Mar 18, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jaap de Bergen
    Replies:
    15
    Views:
    592
    Andrew Thompson
    Sep 1, 2004
  2. Replies:
    1
    Views:
    386
    Lawrence Kirby
    Jul 6, 2005
  3. Polaris431
    Replies:
    8
    Views:
    755
    SM Ryan
    Dec 4, 2006
  4. Deep
    Replies:
    6
    Views:
    482
    Nick Keighley
    Feb 28, 2007
  5. Roedy Green

    byte stream vs char stream buffer

    Roedy Green, May 7, 2014, in forum: Java
    Replies:
    20
    Views:
    201
    Silvio
    May 18, 2014
Loading...

Share This Page