Re: Query.



Not sure I understand your question correctly. But if you have the
byte stream, why couldn't you wrap it up using the InputStreamReader?
The byte stream will be converted to character stream which you can
then save or output to some writer of choice. For example:

try {
out = new YourWriter( // where you want to output );
in = new BufferedReader(new InputStreamReader(
YourByteStream ));

String byteInput;

// byte stream is converted into character stream in next
line
while ((byteInput = in.readLine()) != null) {
out.write(byteInput, 0, byteInput.length());
// more code
}

} catch (IOException e) {
// exception handling code here
}

Hope this helps. -x

On Sep 26, 2:06 pm, Java4jos...@xxxxxxxxx wrote:
Hi,

How can one convert a byte stream into a charcater stream.

We do have Streams (InputStreamReader and OutStream writer) to read
from and write to byteStreams from character streams.

But, If I want to write from a byte stream to a characater stream,
what should be done.

Thank you.


.



Relevant Pages

  • Re: Need help figuring out errors in program
    ... BufferedReader and InputStreamReader classes and you should see it ... > you read something with a stream, ... > the stream into characters. ...
    (comp.lang.java.help)
  • Re: convenient way to read text file multiple times without reopening it
    ... my program opens the file ... but not when I create InputStreamReader from that FileInputStream. ... BufferedReader provides the decoded char buffer, but the InputStreamReader is still responsible for the binary reading, and thus it does maintain it's own private bytebuffer. ... When it comes to streams, once you wrap one stream with another stream, any further direct changes to the underling stream usually result in "undefined" behavior of the outer stream. ...
    (comp.lang.java.programmer)
  • Re: Stream, Reader and text vs binary
    ... InputStreamReader and not BufferedReader. ... Even if you ask for a single character, ... grab a block of three bytes. ... That is not very friendly towards other using the same stream. ...
    (comp.lang.java.programmer)
  • Re: OT What does RET (Enter) do and how does it do it ??
    ... just a stream of characters read from the appropriate buffer. ... of what vi does with the character stream it receives. ... That was a Hebrew word processing program. ... If food be the music of love, eat up, eat up. ...
    (Fedora)
  • Re: network programming
    ... |> what matters is if it is a binary or character stream (and ... few people know that CMUCL actually does provide a form ... It started with sockets and now I'm trying to learn all there is to know ...
    (comp.lang.lisp)