138 |
public void close() throws IOException |
public void close() throws IOException |
139 |
{ |
{ |
140 |
in.close(); |
in.close(); |
141 |
|
in = null; |
142 |
} |
} |
143 |
|
|
144 |
/** |
/** |
150 |
*/ |
*/ |
151 |
public String getEncoding() |
public String getEncoding() |
152 |
{ |
{ |
153 |
return(in.getSchemeName()); |
return in.getSchemeName(); |
154 |
} |
} |
155 |
|
|
156 |
/** |
/** |
166 |
*/ |
*/ |
167 |
public boolean ready() throws IOException |
public boolean ready() throws IOException |
168 |
{ |
{ |
169 |
return(in.ready()); |
if (in == null) |
170 |
|
throw new IOException("Reader has been closed"); |
171 |
|
|
172 |
|
return in.ready(); |
173 |
} |
} |
174 |
|
|
175 |
/** |
/** |
187 |
*/ |
*/ |
188 |
public int read (char[] buf, int offset, int length) throws IOException |
public int read (char[] buf, int offset, int length) throws IOException |
189 |
{ |
{ |
190 |
|
if (in == null) |
191 |
|
throw new IOException("Reader has been closed"); |
192 |
|
|
193 |
return in.read(buf, offset, length); |
return in.read(buf, offset, length); |
194 |
} |
} |
195 |
|
|
202 |
*/ |
*/ |
203 |
public int read() throws IOException |
public int read() throws IOException |
204 |
{ |
{ |
205 |
return(in.read()); |
if (in == null) |
206 |
|
throw new IOException("Reader has been closed"); |
207 |
|
|
208 |
|
return in.read(); |
209 |
|
} |
210 |
|
|
211 |
|
/** |
212 |
|
* Skips the specified number of chars in the stream. It |
213 |
|
* returns the actual number of chars skipped, which may be less than the |
214 |
|
* requested amount. |
215 |
|
* |
216 |
|
* @param num_chars The requested number of chars to skip |
217 |
|
* |
218 |
|
* @return The actual number of chars skipped. |
219 |
|
* |
220 |
|
* @exception IOException If an error occurs |
221 |
|
*/ |
222 |
|
public long skip(long count) throws IOException |
223 |
|
{ |
224 |
|
if (in == null) |
225 |
|
throw new IOException("Reader has been closed"); |
226 |
|
|
227 |
|
return super.skip(count); |
228 |
} |
} |
229 |
|
|
230 |
} // class InputStreamReader |
} // class InputStreamReader |