Answer the question
In order to leave comments, you need to log in
Why does skip on new FileInputStream(FileDescriptor.in) not work?
Why does skip on new FileInputStream(FileDescriptor.in) not work? Although with System.in skip in similar code it works...
import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.IOException;
public class Soltuion {
public static void main(String[] args) throws IOException {
FileInputStream keyboardStream = new FileInputStream(FileDescriptor.in);
System.out.print(keyboardStream.read() + " ");
keyboardStream.skip(100); // любой аргумент напиши - не сработает
System.out.print(keyboardStream.read() + " ");
System.out.print(keyboardStream.read() + " ");
// Ввод: 8
// Вывод: 56 13 10 (всё считал, а не только 56 c ожиданием нового ввода)
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question