當前位置: 首頁>>代碼示例>>Java>>正文


Java FileOutputStream.getFD方法代碼示例

本文整理匯總了Java中java.io.FileOutputStream.getFD方法的典型用法代碼示例。如果您正苦於以下問題:Java FileOutputStream.getFD方法的具體用法?Java FileOutputStream.getFD怎麽用?Java FileOutputStream.getFD使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.io.FileOutputStream的用法示例。


在下文中一共展示了FileOutputStream.getFD方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: transfer

import java.io.FileOutputStream; //導入方法依賴的package包/類
static public long transfer(long position, long count, FileInputStream src, FileOutputStream dst) throws IOException {
    FileChannel srcChannel = src.getChannel();
    FileChannel dstChannel = dst.getChannel();
    if (!srcChannel.isOpen()) {
        throw new ClosedChannelException();
    }
    if (!dstChannel.isOpen()) {
        throw new ClosedChannelException();
    }

    if (position < 0 || count < 0) {
        throw new IllegalArgumentException("position=" + position + " count=" + count);
    }

    if (count == 0 || position >= srcChannel.size()) {
        return 0;
    }
    count = Math.min(count, srcChannel.size() - position);

    FileDescriptor inFd = src.getFD();
    FileDescriptor outFd = dst.getFD();
    long rc = 0;
    rc = native_sendfile_64(outFd, inFd, position, count);
    return rc;
}
 
開發者ID:archos-sa,項目名稱:aos-FileCoreLibrary,代碼行數:26,代碼來源:ArchosFileChannel.java

示例2: openFile

import java.io.FileOutputStream; //導入方法依賴的package包/類
protected void openFile() throws HsqlException {

        try {
            FileOutputStream fos = new FileOutputStream(outFile, true);

            outDescriptor = fos.getFD();
            fileStreamOut = new DeflaterOutputStream(fos,
                    new Deflater(Deflater.DEFAULT_COMPRESSION), bufferSize);
        } catch (IOException e) {
            throw Trace.error(Trace.FILE_IO_ERROR, Trace.Message_Pair,
                              new Object[] {
                e.getMessage(), outFile
            });
        }
    }
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:16,代碼來源:ScriptWriterZipped.java

示例3: openFile

import java.io.FileOutputStream; //導入方法依賴的package包/類
/**
 *  File is opened in append mode although in current usage the file
 *  never pre-exists
 */
protected void openFile() throws HsqlException {

    try {
        FileOutputStream fos = new FileOutputStream(outFile, true);

        outDescriptor = fos.getFD();
        fileStreamOut = new BufferedOutputStream(fos, 2 << 12);
    } catch (IOException e) {
        throw Trace.error(Trace.FILE_IO_ERROR, Trace.Message_Pair,
                          new Object[] {
            e.getMessage(), outFile
        });
    }
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:19,代碼來源:ScriptWriterBase.java

示例4: write

import java.io.FileOutputStream; //導入方法依賴的package包/類
/**
 * Write the data to the file indicate by fileName. The file is created if
 * it doesn't exists.
 */
public static void write(Activity activity, String data, String fileName) throws IOException {
    FileOutputStream fo = activity.openFileOutput(fileName, 0);
    BufferedWriter bf = new BufferedWriter(new FileWriter(fo.getFD()));
    bf.write(data);
    bf.flush();
    bf.close();
}
 
開發者ID:victordiaz,項目名稱:phonk,代碼行數:12,代碼來源:FileIO.java

示例5: FileSync

import java.io.FileOutputStream; //導入方法依賴的package包/類
FileSync(FileOutputStream os) throws IOException {
    outDescriptor = os.getFD();
}
 
開發者ID:tiweGH,項目名稱:OpenDiabetes,代碼行數:4,代碼來源:FileUtil.java

示例6: FileSync

import java.io.FileOutputStream; //導入方法依賴的package包/類
FileSync(FileOutputStream os) throws java.io.IOException {
    outDescriptor = os.getFD();
}
 
開發者ID:s-store,項目名稱:sstore-soft,代碼行數:4,代碼來源:FileUtil.java


注:本文中的java.io.FileOutputStream.getFD方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。