0ec7fbeb4e282ee7538d30e05589190591a4fec0
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / main / java / org / opendaylight / controller / cluster / datastore / node / utils / stream / ForwardingDataInput.java
1 /*
2  * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.cluster.datastore.node.utils.stream;
9
10 import java.io.DataInput;
11 import java.io.IOException;
12 import org.eclipse.jdt.annotation.NonNull;
13
14 // Not a ForwardingObject because delegate() can legally throw and we do not want redirect toString()
15 abstract class ForwardingDataInput implements DataInput {
16
17     abstract @NonNull DataInput delegate() throws IOException;
18
19     @Override
20     @SuppressWarnings("checkstyle:parameterName")
21     public final void readFully(final byte[] b) throws IOException {
22         delegate().readFully(b);
23     }
24
25     @Override
26     @SuppressWarnings("checkstyle:parameterName")
27     public final void readFully(final byte[] b, final int off, final int len) throws IOException {
28         delegate().readFully(b, off, len);
29     }
30
31     @Override
32     @SuppressWarnings("checkstyle:parameterName")
33     public final int skipBytes(final int n) throws IOException {
34         return delegate().skipBytes(n);
35     }
36
37     @Override
38     public final boolean readBoolean() throws IOException {
39         return delegate().readBoolean();
40     }
41
42     @Override
43     public final byte readByte() throws IOException {
44         return delegate().readByte();
45     }
46
47     @Override
48     public final int readUnsignedByte() throws IOException {
49         return delegate().readUnsignedByte();
50     }
51
52     @Override
53     public final short readShort() throws IOException {
54         return delegate().readShort();
55     }
56
57     @Override
58     public final int readUnsignedShort() throws IOException {
59         return delegate().readUnsignedShort();
60     }
61
62     @Override
63     public final char readChar() throws IOException {
64         return delegate().readChar();
65     }
66
67     @Override
68     public final int readInt() throws IOException {
69         return delegate().readInt();
70     }
71
72     @Override
73     public final long readLong() throws IOException {
74         return delegate().readLong();
75     }
76
77     @Override
78     public final float readFloat() throws IOException {
79         return delegate().readFloat();
80     }
81
82     @Override
83     public final double readDouble() throws IOException {
84         return delegate().readDouble();
85     }
86
87     @Override
88     public final String readLine() throws IOException {
89         return delegate().readLine();
90     }
91
92     @Override
93     public final String readUTF() throws IOException {
94         return delegate().readUTF();
95     }
96 }