classpath-patches
[Top][All Lists]
Advanced

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

RE: [cp-patches] FYI: Fixlet for DataInputStream.readLine


From: Jeroen Frijters
Subject: RE: [cp-patches] FYI: Fixlet for DataInputStream.readLine
Date: Wed, 15 Jun 2005 18:00:23 +0200

Hi Roman,

I don't think this is a good idea. It adds a dependency on the internals
of two other classes and assumes invariants that may not even be true
(for example, think of subclasses of BufferedInputStream). It also seems
like it is too complicated for very little gain. Do you have a real
world scenario where performance is hurt by the previous approach?

Regards,
Jeroen

> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden 
> On Behalf Of Roman Kennke
> Sent: Wednesday, June 15, 2005 17:21
> To: address@hidden
> Subject: [cp-patches] FYI: Fixlet for DataInputStream.readLine
> 
> I added an optimization to DataInputStream.readLine(). If this method 
> needs to push back a character, it used to wrap the field in into a 
> PushbackInputStream. This is not always necessary, especially 
> in cases 
> where in is an InputStream that supports the pos field for 
> repositioning. I committed this.
> 
> 2005-06-15  Roman Kennke  <address@hidden>
> 
>     * java/io/DataInputStream.java
>     (readLine): Added checks for InputStream that support 
> have a pos field
>     for repositioning the stream.
> 
> /Roman
> 




reply via email to

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