001/*
002 *  Licensed to the Apache Software Foundation (ASF) under one
003 *  or more contributor license agreements.  See the NOTICE file
004 *  distributed with this work for additional information
005 *  regarding copyright ownership.  The ASF licenses this file
006 *  to you under the Apache License, Version 2.0 (the
007 *  "License"); you may not use this file except in compliance
008 *  with the License.  You may obtain a copy of the License at
009 *
010 *        http://www.apache.org/licenses/LICENSE-2.0
011 *
012 *  Unless required by applicable law or agreed to in writing,
013 *  software distributed under the License is distributed on an
014 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *  KIND, either express or implied.  See the License for the
016 *  specific language governing permissions and limitations
017 *  under the License.
018 */
019
020package org.apache.isis.core.commons.encoding;
021
022import java.io.DataInputStream;
023import java.io.IOException;
024
025public class DataInputExtendedDecorator implements DataInputExtended {
026
027    private final DataInputExtended underlying;
028
029    public DataInputExtendedDecorator(final DataInputExtended underlying) {
030        this.underlying = underlying;
031    }
032
033    @Override
034    public DataInputStream getDataInputStream() {
035        return underlying.getDataInputStream();
036    }
037
038    // ////////////////////////////////////////
039    // Boolean, Char
040    // ////////////////////////////////////////
041
042    @Override
043    public boolean readBoolean() throws IOException {
044        return underlying.readBoolean();
045    }
046
047    @Override
048    public boolean[] readBooleans() throws IOException {
049        return underlying.readBooleans();
050    }
051
052    @Override
053    public char readChar() throws IOException {
054        return underlying.readChar();
055    }
056
057    @Override
058    public char[] readChars() throws IOException {
059        return underlying.readChars();
060    }
061
062    // ////////////////////////////////////////
063    // Integral Numbers
064    // ////////////////////////////////////////
065
066    @Override
067    public byte readByte() throws IOException {
068        return underlying.readByte();
069    }
070
071    @Override
072    public int readUnsignedByte() throws IOException {
073        return underlying.readUnsignedByte();
074    }
075
076    @Override
077    public byte[] readBytes() throws IOException {
078        return underlying.readBytes();
079    }
080
081    @Override
082    public short readShort() throws IOException {
083        return underlying.readShort();
084    }
085
086    @Override
087    public int readUnsignedShort() throws IOException {
088        return underlying.readUnsignedShort();
089    }
090
091    @Override
092    public short[] readShorts() throws IOException {
093        return underlying.readShorts();
094    }
095
096    @Override
097    public int readInt() throws IOException {
098        return underlying.readInt();
099    }
100
101    @Override
102    public int[] readInts() throws IOException {
103        return underlying.readInts();
104    }
105
106    @Override
107    public long[] readLongs() throws IOException {
108        return underlying.readLongs();
109    }
110
111    @Override
112    public long readLong() throws IOException {
113        return underlying.readLong();
114    }
115
116    // ////////////////////////////////////////
117    // Floating Point Numbers
118    // ////////////////////////////////////////
119
120    @Override
121    public float readFloat() throws IOException {
122        return underlying.readFloat();
123    }
124
125    @Override
126    public float[] readFloats() throws IOException {
127        return underlying.readFloats();
128    }
129
130    @Override
131    public double readDouble() throws IOException {
132        return underlying.readDouble();
133    }
134
135    @Override
136    public double[] readDoubles() throws IOException {
137        return underlying.readDoubles();
138    }
139
140    // ////////////////////////////////////////
141    // Strings
142    // ////////////////////////////////////////
143
144    @Override
145    public String readUTF() throws IOException {
146        return underlying.readUTF();
147    }
148
149    @Override
150    public String[] readUTFs() throws IOException {
151        return underlying.readUTFs();
152    }
153
154    // ////////////////////////////////////////
155    // Encodable and Serializable
156    // ////////////////////////////////////////
157
158    @Override
159    public <T> T readEncodable(final Class<T> encodableType) throws IOException {
160        return underlying.readEncodable(encodableType);
161    }
162
163    @Override
164    public <T> T[] readEncodables(final Class<T> encodableType) throws IOException {
165        return underlying.readEncodables(encodableType);
166    }
167
168    @Override
169    public <T> T readSerializable(final Class<T> serializableType) throws IOException {
170        return underlying.readSerializable(serializableType);
171    }
172
173    @Override
174    public <T> T[] readSerializables(final Class<T> serializableType) throws IOException {
175        return underlying.readSerializables(serializableType);
176    }
177
178    // ////////////////////////////////////////
179    // Other
180    // ////////////////////////////////////////
181
182    @Override
183    public void readFully(final byte[] b) throws IOException {
184        underlying.readFully(b);
185    }
186
187    @Override
188    public void readFully(final byte[] b, final int off, final int len) throws IOException {
189        underlying.readFully(b, off, len);
190    }
191
192    @Override
193    public String readLine() throws IOException {
194        return underlying.readLine();
195    }
196
197    @Override
198    public int skipBytes(final int n) throws IOException {
199        return underlying.skipBytes(n);
200    }
201
202    // //////////////////////////////////////////
203    // // Closeable
204    // //////////////////////////////////////////
205    //
206    // public void close() throws IOException {
207    // if (underlying instanceof Closeable) {
208    // Closeable closeable = (Closeable) underlying;
209    // closeable.close();
210    // }
211    // }
212
213}