Another attempt at input stream buffering that uses raw local input stream class