
本文共 2728 字,大约阅读时间需要 9 分钟。
ProgressMonitorInputStream���������
ProgressMonitorInputStream
��������� Java ������������ javax.swing
������������������������������������������������������������������������������������������������������������ InputStream
��������������������������������������������������� ProgressDialog
��������������������������������������������������������������������� InputStream
������ InterruptedIOException
���������������������������������
������������������������ProgressMonitorInputStream
��������� FilterInputStream
��������������� ProgressMonitor
������������������������������������������������������������������������������������
������������
ProgressMonitorInputStream
������������������������
public ProgressMonitorInputStream(Component parentComponent, Object message, InputStream in)
Component parentComponent
������������������������null
������������������������������Object message
������������������������������������������������������������InputStream in
������������������������������������
���������������
ProgressMonitorInputStream in = new ProgressMonitorInputStream(null, "������������", fis);
������������
��������������� read()
���������ProgressMonitorInputStream
���������������������������
int read()
���������������������������������������int read(byte[] b)
������������������������������������������������������ b
���int read(byte[] b, int off, int len)
������������������������������������������������������������ b
������������ off
��������������� len
������������ProgressMonitor getProgressMonitor()
������������������ ProgressMonitor
���������void close()
���������������������������������������������������������������������������
��������������������� ProgressMonitorInputStream
������������������������
import java.io.FileInputStream;import java.io.IOException;import javax.swing.ProgressMonitor;public class Homework15_1 { public static void main(String[] args) throws IOException { File file = new File("word.txt"); byte[] b = new byte[2]; // ������������������������������������������ FileInputStream fis = new FileInputStream(file); ProgressMonitorInputStream in = new ProgressMonitorInputStream(null, "������������", fis); while (in.read(b) != -1) { String s = new String(b); System.out.println(s); Thread.sleep(100); // ������100������������������ } }}
������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������100���������������������������
��������������������������������� try-catch
kh���i������������������������������������������������
发表评论
最新留言
关于作者
