'\n' is itself a single character if it is represented inside Java, but when interacting with external systems, it can be represented anywhere between 1 and 8 bytes. Some systems and protocols are a new line with \r\n , which is 2 characters long. And encoding matters, as this can lead to the fact that each character will use 1, 2 or 4 bytes.
Without additional information about which system or protocol the characters will be sent to it, it is impossible to give a completely accurate answer.
source share