Java LineNumberInputStream .setLineNumber (int lineNumber)
Syntax
LineNumberInputStream.setLineNumber(int lineNumber) has the following syntax.
public void setLineNumber(int lineNumber)
Example
In the following code shows how to use LineNumberInputStream.setLineNumber(int lineNumber) method.
//w w w . j av a 2 s . c o m
import java.io.FileInputStream;
import java.io.IOException;
import java.io.LineNumberInputStream;
public class Main {
public static void main(String[] args) throws IOException {
FileInputStream fis = new FileInputStream("C:/test.txt");
LineNumberInputStream lnis = new LineNumberInputStream(fis);
lnis.setLineNumber(100);
int i = lnis.getLineNumber();
System.out.print("Line number: " + i);
}
}
Home »
Java Tutorial »
java.io »
Java Tutorial »
java.io »