W3C home > Mailing lists > Public > www-jigsaw@w3.org > July to August 2000

ContentLengthInputStream bug

From: Brooks, Thomas <Thomas.Brooks@appnet.com>
Date: Mon, 31 Jul 2000 14:20:43 -0400
Message-ID: <A21194443A45D411BB7E00D0B76DF1EB1B6C6E@cen3.cen.com>
To: "'www-jigsaw@w3.org'" <www-jigsaw@w3.org>

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

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

Best regards,
Tom Brooks 
Senior Systems Architect
AppNet, Inc. 
Received on Monday, 31 July 2000 14:22:02 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:41:29 UTC