src/java.base/unix/classes/sun/nio/ch/DatagramDispatcher.java
changeset 59146 455612b3161a
parent 47216 71c04702a3d5
child 59208 ff7655b93101
equal deleted inserted replaced
59145:ea044aedc2b6 59146:455612b3161a
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 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.net.*;
    29 import java.io.IOException;
    30 
    30 
    31 /**
    31 /**
    32  * Allows different platforms to call different native methods
    32  * Allows different platforms to call different native methods
    33  * for read and write operations.
    33  * for read and write operations.
    34  */
    34  */
    35 
    35 
    36 class DatagramDispatcher extends NativeDispatcher
    36 class DatagramDispatcher extends NativeDispatcher {
    37 {
    37 
    38     static {
    38     static {
    39         IOUtil.load();
    39         IOUtil.load();
    40     }
    40     }
    41 
    41 
    42     int read(FileDescriptor fd, long address, int len) throws IOException {
    42     int read(FileDescriptor fd, long address, int len) throws IOException {
    61 
    61 
    62     void preClose(FileDescriptor fd) throws IOException {
    62     void preClose(FileDescriptor fd) throws IOException {
    63         FileDispatcherImpl.preClose0(fd);
    63         FileDispatcherImpl.preClose0(fd);
    64     }
    64     }
    65 
    65 
       
    66     void dup(FileDescriptor fd1, FileDescriptor fd2) throws IOException {
       
    67         FileDispatcherImpl.dup0(fd1, fd2);
       
    68     }
       
    69 
    66     static native int read0(FileDescriptor fd, long address, int len)
    70     static native int read0(FileDescriptor fd, long address, int len)
    67         throws IOException;
    71         throws IOException;
    68 
    72 
    69     static native long readv0(FileDescriptor fd, long address, int len)
    73     static native long readv0(FileDescriptor fd, long address, int len)
    70         throws IOException;
    74         throws IOException;