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

📄 file.java

📁 实现JAVA界面的代码GWT
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   File.java

package jxl.write.biff;

import common.Logger;
import java.io.IOException;
import java.io.OutputStream;
import jxl.WorkbookSettings;
import jxl.biff.ByteData;
import jxl.read.biff.CompoundFile;

// Referenced classes of package jxl.write.biff:
//            CompoundFile, JxlWriteException

public final class File
{

    private static Logger logger;
    private byte data[];
    private int pos;
    private OutputStream outputStream;
    private int initialFileSize;
    private int arrayGrowSize;
    private WorkbookSettings workbookSettings;
    CompoundFile readCompoundFile;
    static Class class$jxl$write$biff$File; /* synthetic field */

    File(OutputStream os, WorkbookSettings ws, CompoundFile rcf)
    {
        initialFileSize = ws.getInitialFileSize();
        arrayGrowSize = ws.getArrayGrowSize();
        data = new byte[initialFileSize];
        pos = 0;
        outputStream = os;
        workbookSettings = ws;
        readCompoundFile = rcf;
    }

    void close(boolean cs)
        throws IOException, JxlWriteException
    {
        jxl.write.biff.CompoundFile cf = new jxl.write.biff.CompoundFile(data, pos, outputStream, readCompoundFile);
        cf.write();
        outputStream.flush();
        if(cs)
            outputStream.close();
        data = null;
        if(!workbookSettings.getGCDisabled())
            System.gc();
    }

    public void write(ByteData record)
        throws IOException
    {
        byte bytes[];
        byte newdata[];
        for(bytes = record.getBytes(); pos + bytes.length > data.length; data = newdata)
        {
            newdata = new byte[data.length + arrayGrowSize];
            System.arraycopy(data, 0, newdata, 0, pos);
        }

        System.arraycopy(bytes, 0, data, pos, bytes.length);
        pos += bytes.length;
    }

    int getPos()
    {
        return pos;
    }

    void setData(byte newdata[], int pos)
    {
        System.arraycopy(newdata, 0, data, pos, newdata.length);
    }

    public void setOutputFile(OutputStream os)
    {
        if(data != null)
            logger.warn("Rewriting a workbook with non-empty data");
        outputStream = os;
        data = new byte[initialFileSize];
        pos = 0;
    }

    static Class class$(String x0)
    {
        return Class.forName(x0);
        ClassNotFoundException x1;
        x1;
        throw new NoClassDefFoundError(x1.getMessage());
    }

    static 
    {
        logger = Logger.getLogger(class$jxl$write$biff$File != null ? class$jxl$write$biff$File : (class$jxl$write$biff$File = class$("jxl.write.biff.File")));
    }
}

⌨️ 快捷键说明

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