Share via


DataInputStream.ReadLine Method

Definition

Caution

deprecated

See the general contract of the readLine method of DataInput.

[Android.Runtime.Register("readLine", "()Ljava/lang/String;", "")]
[System.Obsolete("deprecated")]
public string? ReadLine ();
[<Android.Runtime.Register("readLine", "()Ljava/lang/String;", "")>]
[<System.Obsolete("deprecated")>]
abstract member ReadLine : unit -> string
override this.ReadLine : unit -> string

Returns

the next line of text from this input stream.

Implements

Attributes

Exceptions

Remarks

See the general contract of the readLine method of DataInput.

Bytes for this operation are read from the contained input stream.

This member is deprecated. This method does not properly convert bytes to characters. As of JDK&nbsp;1.1, the preferred way to read lines of text is via the BufferedReader.readLine() method. Programs that use the DataInputStream class to read lines can be converted to use the BufferedReader class by replacing code of the form: <blockquote><pre> DataInputStream d =&nbsp;new&nbsp;DataInputStream(in); </pre></blockquote> with: <blockquote><pre> BufferedReader d =&nbsp;new&nbsp;BufferedReader(new&nbsp;InputStreamReader(in)); </pre></blockquote>

Java documentation for java.io.DataInputStream.readLine().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to