JavaTM Platform
Standard Ed. 6

java.io
�� PipedOutputStream

java.lang.Object
  �̳��� java.io.OutputStream
      �̳��� java.io.PipedOutputStream
������ʵ�ֵĽӿڣ�
Closeable, Flushable

public class PipedOutputStream
extends OutputStream

���Խ��ܵ���������ӵ��ܵ�������������ͨ�Źܵ����ܵ�������ǹܵ��ķ��Ͷˡ�ͨ����������ij���߳�д�� PipedOutputStream ���󣬲��������̴߳����ӵ� PipedInputStream ��ȡ���������������������ʹ�õ����̣߳���Ϊ�������ܻ���ɸ��߳����������ij���߳��������ӵĹܵ��������ж�ȡ�����ֽڣ������̲߳��ٴ��ڻ״̬����ùܵ�����Ϊ���� �ٻ� ״̬��

�����°汾��ʼ��
JDK1.0
������
PipedInputStream

���췽��ժҪ
PipedOutputStream()
          ������δ���ӵ��ܵ��������Ĺܵ��������
PipedOutputStream(PipedInputStream snk)
          �������ӵ�ָ���ܵ��������Ĺܵ��������
 
����ժҪ
 void close()
          �رմ˹ܵ���������ͷ�������йص�����ϵͳ��Դ��
 void connect(PipedInputStream snk)
          ���˹ܵ���������ӵ������ߡ�
 void flush()
          ˢ�´��������ǿ��д�����л��������ֽڡ�
 void write(byte[] b, int off, int len)
          �� len �ֽڴӳ�ʼƫ����Ϊ off ��ָ�� byte ����д��ùܵ��������
 void write(int b)
          ��ָ�� byte д�봫�͵��������
 
���� java.io.OutputStream �̳еķ���
write
 
���� java.lang.Object �̳еķ���
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

���췽����ϸ��Ϣ

PipedOutputStream

public PipedOutputStream(PipedInputStream snk)
                  throws IOException
�������ӵ�ָ���ܵ��������Ĺܵ��������д������������ֽ��Ժ����� snk �����롣

������
snk - Ҫ���ӵĹܵ���������
�׳���
IOException - ������� I/O ����

PipedOutputStream

public PipedOutputStream()
������δ���ӵ��ܵ��������Ĺܵ��������������ʹ��֮ǰ���ܵ���������ӵ��ܵ����������ȿ��ɽ��������ӣ�Ҳ���ɷ��������ӣ���

������
PipedInputStream.connect(java.io.PipedOutputStream), connect(java.io.PipedInputStream)
������ϸ��Ϣ

connect

public void connect(PipedInputStream snk)
             throws IOException
���˹ܵ���������ӵ������ߡ�����˶����Ѿ����ӵ�����ij���ܵ������������׳� IOException��

��� snk ��δ���ӵĹܵ����������� src ��δ���ӵĹܵ�������������ͨ�����µ���֮һ�������ǣ�

 src.connect(snk)
��
 snk.connect(src)
���������õ�Ч����ͬ��

������
snk - Ҫ���ӵĹܵ���������
�׳���
IOException - ������� I/O ����

write

public void write(int b)
           throws IOException
��ָ�� byte д�봫�͵��������

ʵ�� OutputStream �� write ������

ָ���ߣ�
�� OutputStream �е� write
������
b - Ҫд��� byte��
�׳���
IOException - ����ܵ������ٻ���δ����״̬�����߷��� I/O ����

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
�� len �ֽڴӳ�ʼƫ����Ϊ off ��ָ�� byte ����д��ùܵ���������ڽ������ֽ�д�������֮ǰ���˷���һֱ��������״̬��

���ǣ�
�� OutputStream �е� write
������
b - ���ݡ�
off - �����еij�ʼƫ������
len - Ҫд����ֽ�����
�׳���
IOException - ����ܵ����� �ٻ���δ����״̬�����߷��� I/O ����

flush

public void flush()
           throws IOException
ˢ�´��������ǿ��д�����л��������ֽڡ��⽫֪ͨ���� reader����֪���ǹܵ��е��ַ����ڵȴ��С�

ָ���ߣ�
�ӿ� Flushable �е� flush
���ǣ�
�� OutputStream �е� flush
�׳���
IOException - ������� I/O ����

close

public void close()
           throws IOException
�رմ˹ܵ���������ͷ�������йص�����ϵͳ��Դ�����������޷�������д���ֽڡ�

ָ���ߣ�
�ӿ� Closeable �е� close
���ǣ�
�� OutputStream �е� close
�׳���
IOException - ������� I/O ����

JavaTM Platform
Standard Ed. 6

�ύ��������
�йظ���� API �ο����ϺͿ�����Ա�ĵ�������� Java SE ������Ա�ĵ������ĵ���������ϸ�ġ����򿪷���Ա���������Լ�������������ﶨ�塢ʹ�ü��ɺ͹�������ʾ����

��Ȩ���� 2007 Sun Microsystems, Inc. ��������Ȩ���� ����������֤��������������ĵ����·ַ�������