2 * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.controller.cluster.datastore.node.utils.stream;
10 import java.io.DataInput;
11 import java.io.IOException;
12 import org.eclipse.jdt.annotation.NonNull;
14 // Not a ForwardingObject because delegate() can legally throw and we do not want redirect toString()
15 abstract class ForwardingDataInput implements DataInput {
17 abstract @NonNull DataInput delegate() throws IOException;
20 @SuppressWarnings("checkstyle:parameterName")
21 public final void readFully(final byte[] b) throws IOException {
22 delegate().readFully(b);
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);
32 @SuppressWarnings("checkstyle:parameterName")
33 public final int skipBytes(final int n) throws IOException {
34 return delegate().skipBytes(n);
38 public final boolean readBoolean() throws IOException {
39 return delegate().readBoolean();
43 public final byte readByte() throws IOException {
44 return delegate().readByte();
48 public final int readUnsignedByte() throws IOException {
49 return delegate().readUnsignedByte();
53 public final short readShort() throws IOException {
54 return delegate().readShort();
58 public final int readUnsignedShort() throws IOException {
59 return delegate().readUnsignedShort();
63 public final char readChar() throws IOException {
64 return delegate().readChar();
68 public final int readInt() throws IOException {
69 return delegate().readInt();
73 public final long readLong() throws IOException {
74 return delegate().readLong();
78 public final float readFloat() throws IOException {
79 return delegate().readFloat();
83 public final double readDouble() throws IOException {
84 return delegate().readDouble();
88 public final String readLine() throws IOException {
89 return delegate().readLine();
93 public final String readUTF() throws IOException {
94 return delegate().readUTF();