(-getBytes:range:): Implemented.

(-isEqual:): New method.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@348 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Andrew McCallum 1995-04-13 15:03:10 +00:00
parent 7678bfaab6
commit 9a3802acdc

View file

@ -71,7 +71,7 @@
return [self initWithBytesNoCopy:buf length:length];
}
/* This is one of the designated initializer for NSData */
/* This is one of the designated initializers for NSData */
- (id) initWithBytesNoCopy: (void*)bytes
length: (unsigned int)length
{
@ -125,7 +125,8 @@
- (void)getBytes: (void*)buffer
range: (NSRange)aRange
{
[self notImplemented:_cmd];
/* xxx need to do range checking */
memcpy(buffer, [self bytes] + aRange.location, aRange.length);
}
- (NSData*) subdataWithRange: (NSRange)aRange
@ -134,6 +135,12 @@
return nil;
}
- (BOOL) isEqual: anObject
{
if ([anObject isKindOf:[NSData class]])
return [self isEqualToData:anObject];
return NO;
}
// Querying a Data Object
- (BOOL) isEqualToData: (NSData*)other;