当前位置: 首页>>代码示例>>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;未经允许,请勿转载。