added outputStream.writeN, outputStream.writeUpToN,inputStream.readN, inputStream.readUpToN

InputStreamUtils has a bufferSize already with the same value as you calc here.