Java Code Examples for java.io.FileOutputStream.getFD()

The following are Jave code examples for showing how to use getFD() of the java.io.FileOutputStream class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: aos-FileCoreLibrary   File: ArchosFileChannel.java   View Source Code Vote up 6 votes
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;
}
 
Example 2
Project: parabuild-ci   File: ScriptWriterZipped.java   View Source Code Vote up 5 votes
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
            });
        }
    }
 
Example 3
Project: parabuild-ci   File: ScriptWriterBase.java   View Source Code Vote up 5 votes
/**
 *  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
        });
    }
}
 
Example 4
Project: phonk   File: FileIO.java   View Source Code Vote up 5 votes
/**
 * 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();
}
 
Example 5
Project: OpenDiabetes   File: FileUtil.java   View Source Code Vote up 4 votes
FileSync(FileOutputStream os) throws IOException {
    outDescriptor = os.getFD();
}
 
Example 6
Project: sstore-soft   File: FileUtil.java   View Source Code Vote up 4 votes
FileSync(FileOutputStream os) throws java.io.IOException {
    outDescriptor = os.getFD();
}
 
Example 7
Project: s-store   File: FileUtil.java   View Source Code Vote up 4 votes
FileSync(FileOutputStream os) throws java.io.IOException {
    outDescriptor = os.getFD();
}
 
Example 8
Project: dev-courses   File: FileUtil.java   View Source Code Vote up 4 votes
FileSync(FileOutputStream os) throws IOException {
    outDescriptor = os.getFD();
}
 
Example 9
Project: parabuild-ci   File: FileUtil.java   View Source Code Vote up 4 votes
FileSync(FileOutputStream os) throws java.io.IOException {
    outDescriptor = os.getFD();
}
 
Example 10
Project: parabuild-ci   File: FileUtil.java   View Source Code Vote up 4 votes
FileSync(FileOutputStream os) throws java.io.IOException {
    outDescriptor = os.getFD();
}
 
Example 11
Project: parabuild-ci   File: FileUtil.java   View Source Code Vote up 4 votes
FileSync(FileOutputStream os) throws java.io.IOException {
    outDescriptor = os.getFD();
}