Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8204310

Simpler RandomAccessFile.setLength() on Windows

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 12
    • None
    • core-libs
    • 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().

            igerasim Ivan Gerasimov
            igerasim Ivan Gerasimov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: