SCJP 1.4 SCWCD 1.4
The write method of OutputStream calls the write method of one argument on each of the bytes to be written out. Subclasses are encouraged to override this method and provide a more efficient implementation.
Subclasses of OutputStream must provide an implementation for this method.
Cheers,<br />Roger<br />SCJP 1.2, 1.4, SCBCD 1.3, SCWCD 1.4
Cheers,<br />Roger<br />SCJP 1.2, 1.4, SCBCD 1.3, SCWCD 1.4
SCJP 1.4 SCWCD 1.4
Originally posted by Colin Fletcher:
1. The other code uses a group of objects to provide the StreamObject
specifically:
ByteArrayOutputStream
GZIPOutputStream
I also noticed some other websites use the same style, ByteArrayOutputStream, GZIPOutputStream.
Is this way compression or data managling filters "should" work ?
2. Following "finishing" the stream produces "empty html/body tags"..
The "other" code finishes the GZIP Stream, then obtains the bytes rom the ByteArrayOutputStream and then writes them to the HttpServletResponse object.
3. "write" methods on the stream object.
The sample in the book only implements one. "should we" or "do we have to" implement all the write methods
public void write(int b) throws IOException
public void write(byte b[]) throws IOException
public void write(byte b[], int off, int len) throws IOException
SCJP 1.4 SCWCD 1.4
Don't get me started about those stupid light bulbs. |