Massive speed improvements in InputStream and OutputStream