initial implementation of BufferedInput