ContentLengthInputStream bug

All,

I've been working on a filter and wanted to use the mark() and reset() calls
on the input stream.  When I check if it's support via markSupported(), I
get 'false.'  In actuality, mark() is supported and markSupported() should
return 'true.'

The happens because ContentLengthInputStream extends InputStream, but can be
constructed with any InputStream (sub)class.  When markSupported() is
called, the method invoked is from the superclass, InputStream, returning
'false.'  ContentLengthInputStream should override the markSupported()
method and call markSupported() on it's stream member.  Here's the proper
code:

public boolean markSupported()
{
   if( in == null )
      return false;
   else
      return in.markSupported();
}

Best regards,
Tom
-----------------------------
Tom Brooks 
Senior Systems Architect
AppNet, Inc. 
<http://www.appnet.com/> 

Received on Monday, 31 July 2000 14:22:02 UTC