• 大小: 174KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-12
  • 语言: Java
  • 标签: 飞鸽源码  

资源简介

飞鸽源码(java版)

资源截图

代码片段和文件信息

package ict.ff.ipmsg;

import java.io.*;


public class AutoPipe {
protected InputStream input;
protected OutputStream output;
protected PipeThread thread;
protected int piped;
protected boolean completed;
protected boolean stoped;
protected boolean closed;
protected Exception error;

private class PipeThread extends Thread {

public void run()
        {
            byte buffer[];
            completed = false;
            buffer = new byte[IPMSG.MAX_SOCKBUF];
            int readlen = -1;
            stoped = false;
            try
            {
                while(!stoped) 
                {
                    readlen = input.read(buffer);
                    if(readlen == -1)
                    {
                        completed = true;
                        break;
                    }
                    output.write(buffer 0 readlen);
                    piped += readlen;
                    if(input.available() == 0)
                        output.flush();
                }
            }
            catch(DirectoryOutputException e)
            {
                completed = true;
//                break MISSING_BLOCK_LABEL_183;
            }
            catch(IOException e)
            {
                error = e;
//                break MISSING_BLOCK_LABEL_183;
            }
//              goto _L1
//            Exception exception;
//            exception;
            try
            {
                close();
            }
            catch(IOException e1)
            {
                e1.printStackTrace();
            }
//            throw exception;
//_L1:
            try
            {
                close();
            }
            catch(IOException e1)
            {
                e1.printStackTrace();
            }
//            break MISSING_BLOCK_LABEL_200;
            try
            {
                close();
            }
            catch(IOException e1)
            {
                e1.printStackTrace();
            }
        }

final AutoPipe this$0;

private PipeThread() {
this$0 = AutoPipe.this;
// super();
}

PipeThread(PipeThread pipethread) {
this();
}
}

public AutoPipe(InputStream input OutputStream output) {
this.input = null;
this.output = null;
thread = null;
piped = 0;
completed = false;
stoped = false;
closed = false;
error = null;
if (input == null || output == null) {
throw new NullPointerException();
} else {
this.input = input;
this.output = output;
thread = new PipeThread(null);
return;
}
}

public void start() {
stoped = false;
thread.start();
}

public void stop() {
stoped = true;
}

public void close() throws IOException {
if (closed)
return;
IOException exception = null;
try {
input.close();
} catch (IOException e) {
exception = e;
}
closed = true;
output.cl

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        359  2098-01-01 08:00  test\.classpath

     文件        665  2098-01-01 08:00  test\.project

    .......      1789  2008-07-07 16:50  test\bin\ict\ff\ipmsg\AutoPipe$PipeThread.class

    .......      1971  2008-07-07 16:50  test\bin\ict\ff\ipmsg\AutoPipe.class

    .......      4105  2008-07-07 16:50  test\bin\ict\ff\ipmsg\DirectoryInputStream.class

    .......       394  2008-07-07 16:50  test\bin\ict\ff\ipmsg\DirectoryOutputException.class

    .......      3884  2008-07-07 16:50  test\bin\ict\ff\ipmsg\DirectoryOutputStream.class

    .......       768  2008-07-07 16:50  test\bin\ict\ff\ipmsg\EntryListener.class

    .......       764  2008-07-07 16:50  test\bin\ict\ff\ipmsg\ExitListener.class

    .......       519  2008-07-07 16:50  test\bin\ict\ff\ipmsg\FileData.class

    .......      4138  2008-07-07 16:50  test\bin\ict\ff\ipmsg\IPMSG.class

    .......       754  2008-07-07 16:50  test\bin\ict\ff\ipmsg\IpmsgChannel$1.class

    .......      3258  2008-07-07 16:50  test\bin\ict\ff\ipmsg\IpmsgChannel$ServerSockThread.class

    .......     19633  2008-07-07 16:50  test\bin\ict\ff\ipmsg\IpmsgChannel.class

    .......       748  2008-07-07 16:50  test\bin\ict\ff\ipmsg\IpmsgSocket$1.class

    .......       564  2008-07-07 16:50  test\bin\ict\ff\ipmsg\IpmsgSocket$Buffer.class

    .......       601  2008-07-07 16:50  test\bin\ict\ff\ipmsg\IpmsgSocket$FileTransferThread.class

    .......       849  2008-07-07 16:50  test\bin\ict\ff\ipmsg\IpmsgSocket$OutputThread.class

    .......      1084  2008-07-07 16:50  test\bin\ict\ff\ipmsg\IpmsgSocket$ReceiveFileThread.class

    .......      1505  2008-07-07 16:50  test\bin\ict\ff\ipmsg\IpmsgSocket$SocketThread.class

    .......       592  2008-07-07 16:50  test\bin\ict\ff\ipmsg\IpmsgSocket$SuperviseThread.class

    .......      9863  2008-07-07 16:50  test\bin\ict\ff\ipmsg\IpmsgSocket.class

    .......       759  2008-07-07 16:50  test\bin\ict\ff\ipmsg\Member.class

    .......       452  2008-07-07 16:50  test\bin\ict\ff\ipmsg\MemberEvent.class

    .......       573  2008-07-07 16:50  test\bin\ict\ff\ipmsg\MessageEvent.class

    .......       779  2008-07-07 16:50  test\bin\ict\ff\ipmsg\MessageListener.class

     目录          0  2008-07-07 16:50  test\bin\ict\ff\ipmsg

    .......      3065  2008-07-07 16:50  test\bin\ict\ff\ui\Config.class

    .......      1209  2008-07-07 16:50  test\bin\ict\ff\ui\ConfigDialog$1.class

    .......       749  2008-07-07 16:50  test\bin\ict\ff\ui\ConfigDialog$2.class

............此处省略70个文件信息

评论

共有 条评论

相关资源