The definition of available for LineNumberInputStream is
public int available() throws IOException {
return (pushBack == -1) ? super.available() : super.available() + 1;
}
but it should be
public int available() throws IOException {
return (pushBack == -1) ? super.available()/2 : super.available()/2 + 1;
}
because if the contained stream can supply n bytes it might turn out
that LineNumberInputStream can supply only n/2 bytes if the n bytes
are a pile of \\r\\n pairs, right?
public int available() throws IOException {
return (pushBack == -1) ? super.available() : super.available() + 1;
}
but it should be
public int available() throws IOException {
return (pushBack == -1) ? super.available()/2 : super.available()/2 + 1;
}
because if the contained stream can supply n bytes it might turn out
that LineNumberInputStream can supply only n/2 bytes if the n bytes
are a pile of \\r\\n pairs, right?