how to split dstream based on newline code example Example: split by new line java String lines[] = string.split("\\r?\\n");