private void transfer(Message msg) throws IOException {
        byte buf[] = new byte[1024];
        
        FileInputStream dis = null;
        int readn = -1;
        
        dis = new FileInputStream(msg.file);
        if (oos == null) {
            oos = new ObjectOutputStream(net.getWriteStream());
        }
        
        for (;;) {
            readn = dis.read(buf);
            if (readn == -1) {
                break;
            }
            oos.write(buf, 0, readn);
        }
        
        oos.flush();
        if (dis != null) {
            dis.close();
        }
    }