src/java.base/share/classes/sun/nio/ch/NativeDispatcher.java
changeset 59146 455612b3161a
parent 47216 71c04702a3d5
child 59208 ff7655b93101
equal deleted inserted replaced
59145:ea044aedc2b6 59146:455612b3161a
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 package sun.nio.ch;
    26 package sun.nio.ch;
    27 
    27 
    28 import java.io.*;
    28 import java.io.FileDescriptor;
       
    29 import java.io.IOException;
    29 
    30 
    30 /**
    31 /**
    31  * Allows different platforms to call different native methods
    32  * Allows different platforms to call different native methods
    32  * for read and write operations.
    33  * for read and write operations.
    33  */
    34  */
    34 
    35 
    35 abstract class NativeDispatcher
    36 abstract class NativeDispatcher {
    36 {
       
    37 
    37 
    38     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     /**
    75     //
    75     //
    76     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     /**
       
    81      * Duplicates a file descriptor.
       
    82      * @param fd1 the file descriptor to duplicate
       
    83      * @param fd2 the new file descriptor, the socket or file that it is connected
       
    84      *            to will be closed by this method
       
    85      */
       
    86     void dup(FileDescriptor fd1, FileDescriptor fd2) throws IOException {
       
    87         throw new UnsupportedOperationException();
       
    88     }
    80 }
    89 }