I'm not 100% sure, but I found an example of the method working incorrectly as compared to BufferedReader.readLine(). Here's the code:
import java.io.*;
public class HelloWorld {
public static void main(String[] args) throws Exception {
String s = "喜\n";
InputStream in = new ByteArrayInputStream(s.getBytes());
DataInputStream d = new DataInputStream(in);
System.out.println(d.readLine()); // prints å
in = new ByteArrayInputStream(s.getBytes());
BufferedReader br = new BufferedReader(new InputStreamReader(in));
System.out.println(br.readLine()); // prints 喜
}
}
Basically, it doesn't appear that DataInputStream handles multi-byte characters at all since it basically does char next = (char)in.read(); for each character.
Essentially, I think that you need at least a very small buffer in order to properly read multi-byte characters. That said, you could probably build your custom method on top of InputStreamReader directly instead of BufferedReader, since that will properly handle multi-byte characters. Alternatively, if you know you're always going to be dealing with ascii then you're probably safe using the deprecated method.
EDIT: it's also worth noting that even DataInputStream buffers internally in order to properly handle \r\n line endings. In jdk7, at least, the handling for \r is:
case '\r':
int c2 = in.read();
if ((c2 != '\n') && (c2 != -1)) {
if (!(in instanceof PushbackInputStream)) {
in = new PushbackInputStream(in);
}
((PushbackInputStream)in).unread(c2);
}
break loop;
Thus, if we encounter something like \ra, the a is unread back onto a pushback input stream, which maintains an internal buffer of unread bytes.