comment added: readAndCloseStream() returns null if input is null