src/java.base/windows/classes/sun/nio/ch/PipeImpl.java
author bpb
Wed, 14 Feb 2018 08:15:07 -0800
changeset 48896 1e358cc5af98
parent 47216 71c04702a3d5
permissions -rw-r--r--
8144672: (ch) PipeImpl should use localhost instead of loopback address Reviewed-by: alanb, clanger
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
48896
1e358cc5af98 8144672: (ch) PipeImpl should use localhost instead of loopback address
bpb
parents: 47216
diff changeset
     2
 * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
package sun.nio.ch;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.net.InetAddress;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.net.InetSocketAddress;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.nio.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.nio.channels.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.nio.channels.spi.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.security.AccessController;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.security.PrivilegedExceptionAction;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import java.security.PrivilegedActionException;
39748
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
    40
import java.security.SecureRandom;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import java.util.Random;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * A simple Pipe implementation based on a socket connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
class PipeImpl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    extends Pipe
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
{
39748
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
    51
    // Number of bytes in the secret handshake.
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
    52
    private static final int NUM_SECRET_BYTES = 16;
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
    53
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
    54
    // Random object for handshake values
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
    55
    private static final Random RANDOM_NUMBER_GENERATOR = new SecureRandom();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    // Source and sink channels
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    private SourceChannel source;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    private SinkChannel sink;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    private class Initializer
895
67f1dc69ad10 6726309: Compiler warnings in nio code
alanb
parents: 2
diff changeset
    62
        implements PrivilegedExceptionAction<Void>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        private final SelectorProvider sp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
15007
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    67
        private IOException ioe = null;
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    68
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        private Initializer(SelectorProvider sp) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
            this.sp = sp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
15007
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    73
        @Override
895
67f1dc69ad10 6726309: Compiler warnings in nio code
alanb
parents: 2
diff changeset
    74
        public Void run() throws IOException {
15007
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    75
            LoopbackConnector connector = new LoopbackConnector();
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    76
            connector.run();
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    77
            if (ioe instanceof ClosedByInterruptException) {
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    78
                ioe = null;
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    79
                Thread connThread = new Thread(connector) {
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    80
                    @Override
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    81
                    public void interrupt() {}
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    82
                };
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    83
                connThread.start();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                for (;;) {
15007
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    85
                    try {
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    86
                        connThread.join();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
                        break;
15007
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    88
                    } catch (InterruptedException ex) {}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
                }
15007
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    90
                Thread.currentThread().interrupt();
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    91
            }
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    92
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    93
            if (ioe != null)
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    94
                throw new IOException("Unable to establish loopback connection", ioe);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
15007
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    96
            return null;
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    97
        }
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    98
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
    99
        private class LoopbackConnector implements Runnable {
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   100
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   101
            @Override
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   102
            public void run() {
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   103
                ServerSocketChannel ssc = null;
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   104
                SocketChannel sc1 = null;
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   105
                SocketChannel sc2 = null;
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   106
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
                try {
39748
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
   108
                    // Create secret with a backing array.
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
   109
                    ByteBuffer secret = ByteBuffer.allocate(NUM_SECRET_BYTES);
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
   110
                    ByteBuffer bb = ByteBuffer.allocate(NUM_SECRET_BYTES);
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
   111
15007
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   112
                    // Loopback address
48896
1e358cc5af98 8144672: (ch) PipeImpl should use localhost instead of loopback address
bpb
parents: 47216
diff changeset
   113
                    InetAddress lb = InetAddress.getLoopbackAddress();
15007
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   114
                    assert(lb.isLoopbackAddress());
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   115
                    InetSocketAddress sa = null;
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   116
                    for(;;) {
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   117
                        // Bind ServerSocketChannel to a port on the loopback
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   118
                        // address
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   119
                        if (ssc == null || !ssc.isOpen()) {
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   120
                            ssc = ServerSocketChannel.open();
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   121
                            ssc.socket().bind(new InetSocketAddress(lb, 0));
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   122
                            sa = new InetSocketAddress(lb, ssc.socket().getLocalPort());
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   123
                        }
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   124
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   125
                        // Establish connection (assume connections are eagerly
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   126
                        // accepted)
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   127
                        sc1 = SocketChannel.open(sa);
39748
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
   128
                        RANDOM_NUMBER_GENERATOR.nextBytes(secret.array());
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
   129
                        do {
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
   130
                            sc1.write(secret);
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
   131
                        } while (secret.hasRemaining());
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
   132
                        secret.rewind();
15007
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   133
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   134
                        // Get a connection and verify it is legitimate
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   135
                        sc2 = ssc.accept();
39748
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
   136
                        do {
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
   137
                            sc2.read(bb);
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
   138
                        } while (bb.hasRemaining());
15007
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   139
                        bb.rewind();
39748
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
   140
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
   141
                        if (bb.equals(secret))
15007
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   142
                            break;
39748
4ae457391658 8145446: Perfect pipe placement
bpb
parents: 25859
diff changeset
   143
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
                        sc2.close();
15007
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   145
                        sc1.close();
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   146
                    }
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   147
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   148
                    // Create source and sink channels
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   149
                    source = new SourceChannelImpl(sp, sc1);
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   150
                    sink = new SinkChannelImpl(sp, sc2);
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   151
                } catch (IOException e) {
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   152
                    try {
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   153
                        if (sc1 != null)
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   154
                            sc1.close();
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   155
                        if (sc2 != null)
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   156
                            sc2.close();
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   157
                    } catch (IOException e2) {}
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   158
                    ioe = e;
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   159
                } finally {
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   160
                    try {
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   161
                        if (ssc != null)
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   162
                            ssc.close();
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   163
                    } catch (IOException e2) {}
31d8a6072b16 8002306: (se) Selector.open fails if invoked with thread interrupt status set [win]
dxu
parents: 5506
diff changeset
   164
                }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    PipeImpl(final SelectorProvider sp) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
            AccessController.doPrivileged(new Initializer(sp));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        } catch (PrivilegedActionException x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
            throw (IOException)x.getCause();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    public SourceChannel source() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        return source;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    public SinkChannel sink() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        return sink;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
}