Completed
Details
Assignee
UnassignedUnassignedReporter
Colin JonesColin JonesApproval
OkPatch
CodePriority
MinorAffects versions
Fix versions
Details
Details
Assignee
Unassigned
UnassignedReporter
Colin Jones
Colin JonesApproval
Ok
Patch
Code
Priority
Affects versions
Fix versions
Created January 12, 2012 at 1:16 AM
Updated August 18, 2012 at 1:50 PM
Resolved August 18, 2012 at 1:50 PM
In some situations, it's necessary to configure the buffer size of LineNumberingPushbackReader's wrapped java.io.LineNumberReader, that gets created in the constructor. A concrete problem case is where you want to avoid doing reads from the underlying Reader whenever possible, so using a buffer size of 1 makes it a bit lazier. I can also imagine cases where you'd want to increase the buffer from java.io.BufferedReader's 8192-char default, but I haven't dealt with that one directly.
There's no good way to do this by subclassing LineNumberingPushbackReader, since all the action happens in the constructors: those of java.io.LineNumberReader and the superclass of LineNumberingPushbackReader, which is java.io.PushbackReader. So my current workaround is to copy the entirety of LineNumberingPushbackReader, change the name, and add a constructor. Having LineNumberingPushbackReader support this directly would be great.
Both java.io.LineNumberReader and java.io.PushbackReader have constructors that accept the buffer size as the second argument, so it seems very reasonable to me to add a similar constructor for LineNumberingPushbackReader.