69 |
*/ |
*/ |
70 |
public class FilterInputStream extends InputStream |
public class FilterInputStream extends InputStream |
71 |
{ |
{ |
|
|
|
|
/*************************************************************************/ |
|
|
|
|
|
/* |
|
|
* Instance Variables |
|
|
*/ |
|
|
|
|
72 |
/** |
/** |
73 |
* This is the subordinate <code>InputStream</code> to which method calls |
* This is the subordinate <code>InputStream</code> to which method calls |
74 |
* are redirected |
* are redirected |
75 |
*/ |
*/ |
76 |
protected InputStream in; |
protected InputStream in; |
77 |
|
|
|
/*************************************************************************/ |
|
|
|
|
|
/* |
|
|
* Constructors |
|
|
*/ |
|
|
|
|
78 |
/** |
/** |
79 |
* Create a <code>FilterInputStream</code> with the specified subordinate |
* Create a <code>FilterInputStream</code> with the specified subordinate |
80 |
* <code>InputStream</code>. |
* <code>InputStream</code>. |
86 |
this.in = in; |
this.in = in; |
87 |
} |
} |
88 |
|
|
|
/*************************************************************************/ |
|
|
|
|
|
/* |
|
|
* Instance Methods |
|
|
*/ |
|
|
|
|
89 |
/** |
/** |
90 |
* Calls the <code>in.mark(int)</code> method. |
* Calls the <code>in.mark(int)</code> method. |
91 |
* |
* |
96 |
in.mark(readlimit); |
in.mark(readlimit); |
97 |
} |
} |
98 |
|
|
|
/*************************************************************************/ |
|
|
|
|
99 |
/** |
/** |
100 |
* Calls the <code>in.markSupported()</code> method. |
* Calls the <code>in.markSupported()</code> method. |
101 |
* |
* |
107 |
return(in.markSupported()); |
return(in.markSupported()); |
108 |
} |
} |
109 |
|
|
|
/*************************************************************************/ |
|
|
|
|
110 |
/** |
/** |
111 |
* Calls the <code>in.reset()</code> method. |
* Calls the <code>in.reset()</code> method. |
112 |
* |
* |
117 |
in.reset(); |
in.reset(); |
118 |
} |
} |
119 |
|
|
|
/*************************************************************************/ |
|
|
|
|
120 |
/** |
/** |
121 |
* Calls the <code>in.available()</code> method. |
* Calls the <code>in.available()</code> method. |
122 |
* |
* |
129 |
return(in.available()); |
return(in.available()); |
130 |
} |
} |
131 |
|
|
|
/*************************************************************************/ |
|
|
|
|
132 |
/** |
/** |
133 |
* Calls the <code>in.skip(long)</code> method |
* Calls the <code>in.skip(long)</code> method |
134 |
* |
* |
143 |
return(in.skip(num_bytes)); |
return(in.skip(num_bytes)); |
144 |
} |
} |
145 |
|
|
|
/*************************************************************************/ |
|
|
|
|
146 |
/** |
/** |
147 |
* Calls the <code>in.read()</code> method |
* Calls the <code>in.read()</code> method |
148 |
* |
* |
155 |
return(in.read()); |
return(in.read()); |
156 |
} |
} |
157 |
|
|
|
/*************************************************************************/ |
|
|
|
|
158 |
/** |
/** |
159 |
* Calls the <code>read(byte[], int, int)</code> overloaded method. |
* Calls the <code>read(byte[], int, int)</code> overloaded method. |
160 |
* Note that |
* Note that |
173 |
return(read(buf, 0, buf.length)); |
return(read(buf, 0, buf.length)); |
174 |
} |
} |
175 |
|
|
|
/*************************************************************************/ |
|
|
|
|
176 |
/** |
/** |
177 |
* Calls the <code>in.read(byte[], int, int)</code> method. |
* Calls the <code>in.read(byte[], int, int)</code> method. |
178 |
* |
* |
189 |
return(in.read(buf, offset, len)); |
return(in.read(buf, offset, len)); |
190 |
} |
} |
191 |
|
|
|
/*************************************************************************/ |
|
|
|
|
192 |
/** |
/** |
193 |
* This method closes the input stream by closing the input stream that |
* This method closes the input stream by closing the input stream that |
194 |
* this object is filtering. Future attempts to access this stream may |
* this object is filtering. Future attempts to access this stream may |