56 |
*/ |
*/ |
57 |
public abstract class FilterWriter extends Writer |
public abstract class FilterWriter extends Writer |
58 |
{ |
{ |
|
/* |
|
|
* Instance Variables |
|
|
*/ |
|
|
|
|
59 |
/** |
/** |
60 |
* This is the subordinate <code>Writer</code> that this class |
* This is the subordinate <code>Writer</code> that this class |
61 |
* redirects its method calls to. |
* redirects its method calls to. |
62 |
*/ |
*/ |
63 |
protected Writer out; |
protected Writer out; |
64 |
|
|
|
/*************************************************************************/ |
|
|
|
|
|
/* |
|
|
* Constructors |
|
|
*/ |
|
|
|
|
65 |
/** |
/** |
66 |
* This method initializes an instance of <code>FilterWriter</code> |
* This method initializes an instance of <code>FilterWriter</code> |
67 |
* to write to the specified subordinate <code>Writer</code>. |
* to write to the specified subordinate <code>Writer</code>. |
76 |
this.out = out; |
this.out = out; |
77 |
} |
} |
78 |
|
|
|
/*************************************************************************/ |
|
|
|
|
|
/* |
|
|
* Instance Methods |
|
|
*/ |
|
|
|
|
79 |
/** |
/** |
80 |
* This method closes the underlying <code>Writer</code>. Any |
* This method closes the underlying <code>Writer</code>. Any |
81 |
* further attempts to write to this stream may throw an exception. |
* further attempts to write to this stream may throw an exception. |
87 |
out.close(); |
out.close(); |
88 |
} |
} |
89 |
|
|
|
/*************************************************************************/ |
|
|
|
|
90 |
/** |
/** |
91 |
* This method attempt to flush all buffered output to be written to the |
* This method attempt to flush all buffered output to be written to the |
92 |
* underlying output sink. |
* underlying output sink. |
98 |
out.flush(); |
out.flush(); |
99 |
} |
} |
100 |
|
|
|
/*************************************************************************/ |
|
|
|
|
101 |
/** |
/** |
102 |
* This method writes a single char of output to the underlying |
* This method writes a single char of output to the underlying |
103 |
* <code>Writer</code>. |
* <code>Writer</code>. |
111 |
out.write(b); |
out.write(b); |
112 |
} |
} |
113 |
|
|
|
/*************************************************************************/ |
|
|
|
|
114 |
/** |
/** |
115 |
* This method writes <code>len</code> chars from the array <code>buf</code> |
* This method writes <code>len</code> chars from the array <code>buf</code> |
116 |
* starting at index <code>offset</code> to the underlying |
* starting at index <code>offset</code> to the underlying |
127 |
out.write(buf, offset, len); |
out.write(buf, offset, len); |
128 |
} |
} |
129 |
|
|
|
/*************************************************************************/ |
|
|
|
|
130 |
/** |
/** |
131 |
* This method writes <code>len</code> chars from the <code>String</code> |
* This method writes <code>len</code> chars from the <code>String</code> |
132 |
* starting at position <code>offset</code>. |
* starting at position <code>offset</code>. |