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

Simpler RandomAccessFile.setLength() on Windows

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 12
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b01
    • OS:
      windows

      Description

      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().

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: