1 21 package proguard.classfile.io; 22 23 import java.io.*; 24 25 31 class RuntimeDataInput 32 { 33 private DataInput dataInput; 34 35 36 public RuntimeDataInput(DataInput dataInput) 37 { 38 this.dataInput = dataInput; 39 } 40 41 42 44 public boolean readBoolean() 45 { 46 try 47 { 48 return dataInput.readBoolean(); 49 } 50 catch (IOException ex) 51 { 52 throw new RuntimeException (ex.getMessage()); 53 } 54 } 55 56 public byte readByte() 57 { 58 try 59 { 60 return dataInput.readByte(); 61 } 62 catch (IOException ex) 63 { 64 throw new RuntimeException (ex.getMessage()); 65 } 66 } 67 68 public char readChar() 69 { 70 try 71 { 72 return dataInput.readChar(); 73 } 74 catch (IOException ex) 75 { 76 throw new RuntimeException (ex.getMessage()); 77 } 78 } 79 80 public double readDouble() 81 { 82 try 83 { 84 return dataInput.readDouble(); 85 } 86 catch (IOException ex) 87 { 88 throw new RuntimeException (ex.getMessage()); 89 } 90 } 91 92 public float readFloat() 93 { 94 try 95 { 96 return dataInput.readFloat(); 97 } 98 catch (IOException ex) 99 { 100 throw new RuntimeException (ex.getMessage()); 101 } 102 } 103 104 public void readFully(byte[] b) 105 { 106 try 107 { 108 dataInput.readFully(b); 109 } 110 catch (IOException ex) 111 { 112 throw new RuntimeException (ex.getMessage()); 113 } 114 } 115 116 public void readFully(byte[] b, int off, int len) 117 { 118 try 119 { 120 dataInput.readFully(b, off, len); 121 } 122 catch (IOException ex) 123 { 124 throw new RuntimeException (ex.getMessage()); 125 } 126 } 127 128 public int readInt() 129 { 130 try 131 { 132 return dataInput.readInt(); 133 } 134 catch (IOException ex) 135 { 136 throw new RuntimeException (ex.getMessage()); 137 } 138 } 139 140 public String readLine() 141 { 142 try 143 { 144 return dataInput.readLine(); 145 } 146 catch (IOException ex) 147 { 148 throw new RuntimeException (ex.getMessage()); 149 } 150 } 151 152 public long readLong() 153 { 154 try 155 { 156 return dataInput.readLong(); 157 } 158 catch (IOException ex) 159 { 160 throw new RuntimeException (ex.getMessage()); 161 } 162 } 163 164 public short readShort() 165 { 166 try 167 { 168 return dataInput.readShort(); 169 } 170 catch (IOException ex) 171 { 172 throw new RuntimeException (ex.getMessage()); 173 } 174 } 175 176 public int readUnsignedByte() 177 { 178 try 179 { 180 return dataInput.readUnsignedByte(); 181 } 182 catch (IOException ex) 183 { 184 throw new RuntimeException (ex.getMessage()); 185 } 186 } 187 188 public int readUnsignedShort() 189 { 190 try 191 { 192 return dataInput.readUnsignedShort(); 193 } 194 catch (IOException ex) 195 { 196 throw new RuntimeException (ex.getMessage()); 197 } 198 } 199 200 public String readUTF() 201 { 202 try 203 { 204 return dataInput.readUTF(); 205 } 206 catch (IOException ex) 207 { 208 throw new RuntimeException (ex.getMessage()); 209 } 210 } 211 212 public int skipBytes(int n) 213 { 214 try 215 { 216 return dataInput.skipBytes(n); 217 } 218 catch (IOException ex) 219 { 220 throw new RuntimeException (ex.getMessage()); 221 } 222 } 223 } 224 | Popular Tags |