classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] Re: Patch: FYI: fix http Headers oddity


From: Michael Koch
Subject: Re: [cp-patches] Re: Patch: FYI: fix http Headers oddity
Date: Thu, 19 May 2005 16:31:02 +0200
User-agent: mutt-ng 1.5.9-r292i (Debian)

On Thu, May 19, 2005 at 10:30:40AM -0400, Bryce McKinlay wrote:
> Chris Burdess wrote:
> 
> >Bryce McKinlay wrote:
> > 
> >>Does anyone know why we use the custom "LineInputStream" class instead of, 
> >>say, BufferedReader here? At one point BufferedReader.readLine() was buggy 
> >>and could "read too 
> >>much" and block before returning a line, but I believe we have fixed that. 
> >>Code re-use would help to avoid bugs like this ;-)
> >>   
> >Erm, because LineInputStream is an InputStream dealing with bytes, and
> >BufferedReader is a Reader dealing with chars.
> > 
> 
> Why is this distinction important? We are converting the result to chars 
> (well, a String) anyway.

LineInputStream reads one byte and transforms it into an ascii character.
BufferedReader reads a char (2 bytes) as character.


Michael
-- 
Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html

Join the community at http://planet.classpath.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]