src/java.base/share/classes/sun/nio/ch/NativeDispatcher.java
branchunixdomainchannels
changeset 58848 c3df0f8b6d93
parent 58801 119ac9128c1b
child 59208 ff7655b93101
equal deleted inserted replaced
58847:692de65ab293 58848:c3df0f8b6d93
    30 /**
    30 /**
    31  * Allows different platforms to call different native methods
    31  * Allows different platforms to call different native methods
    32  * for read and write operations.
    32  * for read and write operations.
    33  */
    33  */
    34 
    34 
    35 public abstract class NativeDispatcher
    35 abstract class NativeDispatcher
    36 {
    36 {
    37 
    37 
    38     public abstract int read(FileDescriptor fd, long address, int len)
    38     abstract int read(FileDescriptor fd, long address, int len)
    39         throws IOException;
    39         throws IOException;
    40 
    40 
    41     /**
    41     /**
    42      * Returns {@code true} if pread/pwrite needs to be synchronized with
    42      * Returns {@code true} if pread/pwrite needs to be synchronized with
    43      * position sensitive methods.
    43      * position sensitive methods.
    53     }
    53     }
    54 
    54 
    55     abstract long readv(FileDescriptor fd, long address, int len)
    55     abstract long readv(FileDescriptor fd, long address, int len)
    56         throws IOException;
    56         throws IOException;
    57 
    57 
    58     public abstract int write(FileDescriptor fd, long address, int len)
    58     abstract int write(FileDescriptor fd, long address, int len)
    59         throws IOException;
    59         throws IOException;
    60 
    60 
    61     int pwrite(FileDescriptor fd, long address, int len, long position)
    61     int pwrite(FileDescriptor fd, long address, int len, long position)
    62         throws IOException
    62         throws IOException
    63     {
    63     {
    65     }
    65     }
    66 
    66 
    67     abstract long writev(FileDescriptor fd, long address, int len)
    67     abstract long writev(FileDescriptor fd, long address, int len)
    68         throws IOException;
    68         throws IOException;
    69 
    69 
    70     public abstract void close(FileDescriptor fd) throws IOException;
    70     abstract void close(FileDescriptor fd) throws IOException;
    71 
    71 
    72     // Prepare the given fd for closing by duping it to a known internal fd
    72     // Prepare the given fd for closing by duping it to a known internal fd
    73     // that's already closed.  This is necessary on some operating systems
    73     // that's already closed.  This is necessary on some operating systems
    74     // (Solaris and Linux) to prevent fd recycling.
    74     // (Solaris and Linux) to prevent fd recycling.
    75     //
    75     //
    76     public void preClose(FileDescriptor fd) throws IOException {
    76     void preClose(FileDescriptor fd) throws IOException {
    77         // Do nothing by default; this is only needed on Unix
    77         // Do nothing by default; this is only needed on Unix
    78     }
    78     }
    79 
    79 
    80 }
    80 }