本文整理汇总了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;
}
示例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
});
}
}
示例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
});
}
}
示例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();
}
示例5: FileSync
import java.io.FileOutputStream; //导入方法依赖的package包/类
FileSync(FileOutputStream os) throws IOException {
outDescriptor = os.getFD();
}
示例6: FileSync
import java.io.FileOutputStream; //导入方法依赖的package包/类
FileSync(FileOutputStream os) throws java.io.IOException {
outDescriptor = os.getFD();
}