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.DataOutputStream; 023import java.io.IOException; 024 025public class DataOutputExtendedDecorator implements DataOutputExtended { 026 027 private final DataOutputExtended underlying; 028 029 public DataOutputExtendedDecorator(final DataOutputExtended underlying) { 030 this.underlying = underlying; 031 } 032 033 @Override 034 public DataOutputStream getDataOutputStream() { 035 return underlying.getDataOutputStream(); 036 } 037 038 // //////////////////////////////////////// 039 // Boolean, Char 040 // //////////////////////////////////////// 041 042 @Override 043 public void writeBoolean(final boolean v) throws IOException { 044 underlying.writeBoolean(v); 045 } 046 047 @Override 048 public void writeBooleans(final boolean[] booleans) throws IOException { 049 underlying.writeBooleans(booleans); 050 } 051 052 @Override 053 public void writeChar(final int v) throws IOException { 054 underlying.writeChar(v); 055 } 056 057 @Override 058 public void writeChars(final char[] chars) throws IOException { 059 underlying.writeChars(chars); 060 } 061 062 // //////////////////////////////////////// 063 // Integral Numbers 064 // //////////////////////////////////////// 065 066 @Override 067 public void write(final int b) throws IOException { 068 underlying.write(b); 069 } 070 071 @Override 072 public void writeByte(final int v) throws IOException { 073 underlying.writeByte(v); 074 } 075 076 @Override 077 public void write(final byte[] b) throws IOException { 078 underlying.write(b); 079 } 080 081 @Override 082 public void writeBytes(final byte[] bytes) throws IOException { 083 underlying.writeBytes(bytes); 084 } 085 086 @Override 087 public void writeShort(final int v) throws IOException { 088 underlying.writeShort(v); 089 } 090 091 @Override 092 public void writeShorts(final short[] shorts) throws IOException { 093 underlying.writeShorts(shorts); 094 } 095 096 @Override 097 public void writeInt(final int v) throws IOException { 098 underlying.writeInt(v); 099 } 100 101 @Override 102 public void writeInts(final int[] ints) throws IOException { 103 underlying.writeInts(ints); 104 } 105 106 @Override 107 public void writeLong(final long v) throws IOException { 108 underlying.writeLong(v); 109 } 110 111 @Override 112 public void writeLongs(final long[] longs) throws IOException { 113 underlying.writeLongs(longs); 114 } 115 116 // //////////////////////////////////////// 117 // Floating Point Numbers 118 // //////////////////////////////////////// 119 120 @Override 121 public void writeFloat(final float v) throws IOException { 122 underlying.writeFloat(v); 123 } 124 125 @Override 126 public void writeFloats(final float[] floats) throws IOException { 127 underlying.writeFloats(floats); 128 } 129 130 @Override 131 public void writeDouble(final double v) throws IOException { 132 underlying.writeDouble(v); 133 } 134 135 @Override 136 public void writeDoubles(final double[] doubles) throws IOException { 137 underlying.writeDoubles(doubles); 138 } 139 140 // //////////////////////////////////////// 141 // Strings 142 // //////////////////////////////////////// 143 144 @Override 145 public void writeUTF(final String str) throws IOException { 146 underlying.writeUTF(str); 147 } 148 149 @Override 150 public void writeUTFs(final String[] strings) throws IOException { 151 underlying.writeUTFs(strings); 152 } 153 154 // //////////////////////////////////////// 155 // Encodable and Serializable 156 // //////////////////////////////////////// 157 158 @Override 159 public void writeEncodable(final Object encodable) throws IOException { 160 underlying.writeEncodable(encodable); 161 } 162 163 @Override 164 public void writeEncodables(final Object[] encodables) throws IOException { 165 underlying.writeEncodables(encodables); 166 } 167 168 @Override 169 public void writeSerializable(final Object serializable) throws IOException { 170 underlying.writeSerializable(serializable); 171 } 172 173 @Override 174 public void writeSerializables(final Object[] serializables) throws IOException { 175 underlying.writeSerializables(serializables); 176 } 177 178 // //////////////////////////////////////// 179 // Other 180 // //////////////////////////////////////// 181 182 @Override 183 public void write(final byte[] b, final int off, final int len) throws IOException { 184 underlying.write(b, off, len); 185 } 186 187 @Override 188 public void writeBytes(final String s) throws IOException { 189 underlying.writeBytes(s); 190 } 191 192 @Override 193 public void writeChars(final String s) throws IOException { 194 underlying.writeChars(s); 195 } 196 197 // //////////////////////////////////////// 198 // Flush 199 // //////////////////////////////////////// 200 201 @Override 202 public void flush() throws IOException { 203 underlying.flush(); 204 } 205 206}