1/*
2 *  Licensed to the Apache Software Foundation (ASF) under one or more
3 *  contributor license agreements.  See the NOTICE file distributed with
4 *  this work for additional information regarding copyright ownership.
5 *  The ASF licenses this file to You under the Apache License, Version 2.0
6 *  (the "License"); you may not use this file except in compliance with
7 *  the License.  You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *  Unless required by applicable law or agreed to in writing, software
12 *  distributed under the License is distributed on an "AS IS" BASIS,
13 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *  See the License for the specific language governing permissions and
15 *  limitations under the License.
16 */
17
18package org.apache.harmony.tests.java.nio.channels;
19
20import java.io.IOException;
21import java.net.DatagramSocket;
22import java.net.SocketAddress;
23import java.nio.ByteBuffer;
24import java.nio.channels.DatagramChannel;
25import java.nio.channels.spi.SelectorProvider;
26
27class MockDatagramChannel extends DatagramChannel {
28
29    public MockDatagramChannel(SelectorProvider arg0) {
30        super(arg0);
31    }
32
33    @Override
34    public DatagramSocket socket() {
35        return null;
36    }
37
38    @Override
39    public boolean isConnected() {
40        return false;
41    }
42
43    @Override
44    public DatagramChannel connect(SocketAddress arg0) throws IOException {
45        return null;
46    }
47
48    @Override
49    public DatagramChannel disconnect() throws IOException {
50        return null;
51    }
52
53    @Override
54    public SocketAddress receive(ByteBuffer arg0) throws IOException {
55        return null;
56    }
57
58    @Override
59    public int send(ByteBuffer arg0, SocketAddress arg1) throws IOException {
60        return 0;
61    }
62
63    @Override
64    public int read(ByteBuffer arg0) throws IOException {
65        return 0;
66    }
67
68    @Override
69    public long read(ByteBuffer[] arg0, int arg1, int arg2) throws IOException {
70        return 0;
71    }
72
73    @Override
74    public int write(ByteBuffer arg0) throws IOException {
75        return 0;
76    }
77
78    @Override
79    public long write(ByteBuffer[] arg0, int arg1, int arg2) throws IOException {
80        return 0;
81    }
82
83    @Override
84    protected void implCloseSelectableChannel() throws IOException {
85        // empty
86    }
87
88    @Override
89    protected void implConfigureBlocking(boolean arg0) throws IOException {
90        // empty
91    }
92
93}
94