-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
b01
-
windows
Currently a file's length is set in three steps:
First, in java.base/windows/native/libjava/io_util_md.c, handleSetLength() the file pointer is set to the desired position with SetFilePointer() and then SetEndOfFile() is called.
Second, in java.base/share/native/libjava/RandomAccessFile.c, Java_java_io_RandomAccessFile_setLength() the file pointer offset is set to the new position.
First two steps can be combined as a single call to SetFileInformationByHandle().
First, in java.base/windows/native/libjava/io_util_md.c, handleSetLength() the file pointer is set to the desired position with SetFilePointer() and then SetEndOfFile() is called.
Second, in java.base/share/native/libjava/RandomAccessFile.c, Java_java_io_RandomAccessFile_setLength() the file pointer offset is set to the new position.
First two steps can be combined as a single call to SetFileInformationByHandle().
- links to