[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSMutableData -replaceBytesInRange:withBytes doesn't follow OpenStep
Re: NSMutableData -replaceBytesInRange:withBytes doesn't follow OpenStep Specs
Fri, 8 Jun 2001 12:15:27 +0100
On Friday, June 8, 2001, at 10:26 AM, Tom Koelman wrote:
I assume this was done on purpose, but nonetheless.
According to the OpenStep specs
- (void) replaceBytesInRange:(NSRange)aRange withBytes:(const
raises an NSRangeException if aRange is not within the range of the
When aRange would extend the receiver however, GNUstep's base library
adjusts the capacity of the NSMutableData.
While the OpenStep spec says that an exception is raised for a range
outside the receivers range,
the MacOS-X documentation changes that to say that the 'location' must
be in the receivers range
and that the data is extended as necessary.
In this case, GNUstep goes with the newer MacOS-X spec, as it seems a
more useful behavior.