Java BufferedReader for zero-terminated strings
问题 I need to read zero-terminated strings from InputStream in Java. Is there similar to BufferedReader.readLine() method for reading zero-terminated strings? 回答1: No. Java doesn't recognise a zero-terminated string as such. You'll have to read the InputStream and look for a 0 byte. Note that this doesn't address the issue of character-encoding. The InputStream will give you the stream of bytes, and you'll then have to encode to characters via a Reader . If you have a multi-byte character