⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filetargetimpl.java

📁 基于Java技术实现的minipacs系统,可以进行诊断信息登记, 嵌入控件查看DICOM 影像和统计分析等功能.
💻 JAVA
字号:
/* * FileTargetImpl.java * * Created on 8. november 2005, 12:08 * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */package backup.client;import java.rmi.*;import java.rmi.server.UnicastRemoteObject;import java.io.*;/** * * @author Thomas */public class FileTargetImpl extends UnicastRemoteObject implements FileTarget {    long bytesTransferred = 0;    File file;    FileOutputStream out;                /**     * Creates a new instance of FileTargetImpl      */    public FileTargetImpl(File file) throws RemoteException, IOException {        this.file = file;        out = new FileOutputStream(file);    }    public int write(byte[] bytes) throws RemoteException {        try {            if (out != null) {                out.write(bytes);                bytesTransferred += bytes.length;                return bytes.length;            }            else {                out.flush();                return -1;            }        } catch (Exception e) {            e.printStackTrace();            return -1;        }    }        public long getFileSize() {        return bytesTransferred;    }        public void fireFileTransfered() throws RemoteException {                    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -