📜  Java.io.LineNumberInputStream类

📅  最后修改于: 2020-11-15 02:45:18             🧑  作者: Mango


介绍

Java.io.LineNumberInputStream类是一个输入流过滤器,它提供了跟踪当前行号的附加功能。的线是用回车字符(“\ R”)结束字节序列,一个新行字符(“\ n”),或回车字符由换行字符紧跟。

类声明

以下是Java.io.LineNumberInputStream类的声明-

public class LineNumberInputStream
   extends Reader

领域

以下是Java.io.LineNumberInputStream类的字段-

  • −中的protected InputStream这是要过滤的输入流。

类的构造函数

Sr.No. Constructor & Description
1

LineNumberInputStream(InputStream in)

This constructs a newline number input stream that reads its input from the specified input stream.

类方法

Sr.No. Method & Description
1 int available()

This method returns the number of bytes that can be read from this input stream without blocking.

2 int getLineNumber()

This method returns the current line number.

3 void mark(int readlimit)

This method marks the current position in this input stream.

4 int read()

This method reads the next byte of data from this input stream.

5 int read(byte[] b, int off, int len)

This method reads up to len bytes of data from this input stream into an array of bytes.

6 void reset()

This method repositions this stream to the position at the time the mark method was last called on this input stream.

7 void setLineNumber(int lineNumber)

This method sets the line number to the specified argument.

8 long skip(long n)

This method skips over and discards n bytes of data from this input stream.

方法继承

此类从以下类继承方法-

  • Java.io.FilterInputStream
  • Java对象