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

📄 zarchive.java

📁 用Java写的报表.功能如下: 0.内建网络打印,网络预览功能! 1.文件操作。包括url 指定的文件。 2.全功能打印支持。包括打印预览。 3.Undo 和 redo。 4.合并单元格。 5.Cel
💻 JAVA
字号:
/*
 * Copyright 2002 EZCell , Inc. All rights reserved.
 * Version  1.0.
 * Author   W.John
 */
package ezcell;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.StreamCorruptedException;


/**
 * put your documentation comment here
 */
class ObjectInputStream2 extends ObjectInputStream {
    public ZDefaultBook book;
    public ZDefaultSheet sheet;

    /**
     * put your documentation comment here
     * @param     ZDefaultSheet sheet
     * @param     InputStream is
     */
    public ObjectInputStream2(ZDefaultSheet sheet, InputStream is)
                       throws IOException, StreamCorruptedException {
        super(is);
        this.sheet = sheet;
    }

    /**
     * put your documentation comment here
     * @param     ZDefaultBook  book
     * @param     InputStream is
     */
    public ObjectInputStream2(ZDefaultBook book, InputStream is)
                       throws IOException, StreamCorruptedException {
        super(is);
        this.book = book;
    }

    /**
     * put your documentation comment here
     * @param     InputStream is
     */
    public ObjectInputStream2(InputStream is) throws IOException, StreamCorruptedException {
        super(is);
    }
}

/**
 * put your documentation comment here
 */
public class ZArchive {
    private byte[] buffer;
    private ByteArrayOutputStream os = new ByteArrayOutputStream(100);
    public ObjectOutputStream out;
    private ByteArrayInputStream is;
    public ObjectInputStream2 in;
    private ZDefaultSheet sheet;

    /**
     * put your documentation comment here
     * @param     ZDefaultSheet sheet
     */
    ZArchive(ZDefaultSheet sheet) {
        this.sheet = sheet;

        try {
            out = new ObjectOutputStream(os);
        } catch (Exception e) {
        }
    }

    /**
     * put your documentation comment here
     * @param sheet
     */
    public void setSheet(ZDefaultSheet sheet) {
        this.sheet = sheet;
    }

    /**
     * put your documentation comment here
     * @return
     */
    public ZDefaultSheet getSheet() {
        return sheet;
    }

    /**
     * put your documentation comment here
     * @exception IOException
     */
    public void createInputStream() throws IOException {
        is = new ByteArrayInputStream(buffer);
        in = new ObjectInputStream2(sheet, is);
    }

    /**
     * put your documentation comment here
     */
    public void flush() throws IOException {
        out.close();
        buffer = os.toByteArray();
    }

    /**
     * put your documentation comment here
     * @return
     */
    public ZBase readObject() {
        ZBase result = null;

        try {
            switch (in.readInt()) {
            case ZBase.CELL:
                result = new ZDefaultCell(sheet);

                break;

            case ZBase.ROW:
                result = new ZRow(sheet);

                break;

            case ZBase.COLUMN:
                result = new ZCol(sheet);

                break;
            }

            //result.loadFromStream(in);
        } catch (IOException ioe) {
        }

        return result;
    }

    /**
     * put your documentation comment here
     * @param obj
     * @param prop
     */
    public void writeObject(ZBase obj, int prop) {
    }
}

⌨️ 快捷键说明

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