mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-26 18:21:04 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@10501 72102866-910b-0410-8b05-ffd578937521
195 lines
6.1 KiB
HTML
195 lines
6.1 KiB
HTML
<html><head>
|
|
<title>NSMutableData</title>
|
|
</head>
|
|
<body>
|
|
<a href ="NSMutableCharacterSet.html">[Previous] </a>
|
|
<a href ="Base.html">[Up] </a>
|
|
<a href ="NSMutableDictionary.html">[Next] </a>
|
|
<h1>NSMutableData</h1>
|
|
<h3>Authors </h3>
|
|
<dl>
|
|
<dt><a href ="http://www.gnustep.org/developers/whoiswho.html">Richard Frith-Macdonald</a>
|
|
<dd>
|
|
</dl>
|
|
<p>Version: $Revision$</p>
|
|
<p>Date: $Date$</p>
|
|
<h2><a name ="cont-0">NSMutableData</a></h2>
|
|
<h2><a name ="NSMutableData">NSMutableData</a></h2>
|
|
<p><b>Declared in: </b> Foundation/NSData.h</p>
|
|
<p><b>Conforms to: </b> NSCoding
|
|
</p>
|
|
<hr>
|
|
|
|
|
|
<h2>Instance Variables </h2>
|
|
<ul>
|
|
</ul>
|
|
<h2>Methods </h2>
|
|
<ul>
|
|
<li ><a href ="NSMutableData.html#method-0">+allocWithZone:</a>
|
|
<li ><a href ="NSMutableData.html#method-1">+dataWithCapacity:</a>
|
|
<li ><a href ="NSMutableData.html#method-2">+dataWithLength:</a>
|
|
<li ><a href ="NSMutableData.html#method-3">-appendBytes:length:</a>
|
|
<li ><a href ="NSMutableData.html#method-4">-appendData:</a>
|
|
<li ><a href ="NSMutableData.html#method-5">-increaseLengthBy:</a>
|
|
<li ><a href ="NSMutableData.html#method-6">-initWithCapacity:</a>
|
|
<li ><a href ="NSMutableData.html#method-7">-initWithLength:</a>
|
|
<li ><a href ="NSMutableData.html#method-8">-mutableBytes</a>
|
|
<li ><a href ="NSMutableData.html#method-9">-replaceBytesInRange:withBytes:</a>
|
|
<li ><a href ="NSMutableData.html#method-10">-resetBytesInRange:</a>
|
|
<li ><a href ="NSMutableData.html#method-11">-serializeAlignedBytesLength:</a>
|
|
<li ><a href ="NSMutableData.html#method-12">-serializeDataAt:ofObjCType:context:</a>
|
|
<li ><a href ="NSMutableData.html#method-13">-serializeInt:</a>
|
|
<li ><a href ="NSMutableData.html#method-14">-serializeInt:atIndex:</a>
|
|
<li ><a href ="NSMutableData.html#method-15">-serializeInts:</a>
|
|
<li ><a href ="NSMutableData.html#method-16">-serializeInts:count:atIndex:</a>
|
|
<li ><a href ="NSMutableData.html#method-17">-setData:</a>
|
|
<li ><a href ="NSMutableData.html#method-18">-setLength:</a>
|
|
</ul>
|
|
<hr><h2>Class Methods </h2>
|
|
<h3><a name ="method-0">allocWithZone:</a></h3>
|
|
+ (id) <b>allocWithZone:</b> (NSZone*)zone;<br>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-1">dataWithCapacity:</a></h3>
|
|
+ (id) <b>dataWithCapacity:</b> (unsigned int)aNumItems;<br>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-2">dataWithLength:</a></h3>
|
|
+ (id) <b>dataWithLength:</b> (unsigned int)length;<br>
|
|
|
|
|
|
<hr>
|
|
<hr><h2>Instances Methods </h2>
|
|
<h3><a name ="method-3">appendBytes:length:</a></h3>
|
|
- (void) <b>appendBytes:</b> (const void*)bytes <b>length:</b> (unsigned int)length;<br>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-4">appendData:</a></h3>
|
|
- (void) <b>appendData:</b> (NSData*)otherData;<br>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-5">increaseLengthBy:</a></h3>
|
|
- (void) <b>increaseLengthBy:</b> (unsigned int)extraLength;<br>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-6">initWithCapacity:</a></h3>
|
|
- (id) <b>initWithCapacity:</b> (unsigned int)capacity;<br>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-7">initWithLength:</a></h3>
|
|
- (id) <b>initWithLength:</b> (unsigned int)length;<br>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-8">mutableBytes</a></h3>
|
|
- (void*) <b>mutableBytes</b>;<br>
|
|
|
|
<p>
|
|
|
|
Returns a pointer to the data storage of the receiver.<br>
|
|
Modifications to the memory pointed to by this pointer will
|
|
change the contents of the object. It is important that
|
|
your code should not try to modify the memory beyond the
|
|
number of bytes given by the <code>-length</code> method.
|
|
</p>
|
|
|
|
<p>
|
|
|
|
NB. if the object is released, or any method that changes its
|
|
size or content is called, then the pointer previously returned
|
|
by this method may cease to be valid.
|
|
</p>
|
|
|
|
<p>
|
|
|
|
This is a 'primitive' method ... you need to implement it
|
|
if you write a subclass of NSMutableData.
|
|
</p>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-9">replaceBytesInRange:withBytes:</a></h3>
|
|
- (void) <b>replaceBytesInRange:</b> (NSRange)range <b>withBytes:</b> (const void*)bytes;<br>
|
|
|
|
<p>
|
|
|
|
Replaces the bytes of data in the specified range with a
|
|
copy of the new bytes supplied.<br>
|
|
If the location of the range specified lies beyond the end
|
|
of the data (<code>[self length] < range.location</code>)
|
|
then a range exception is raised.<br>
|
|
Otherwise, if the range specified extends beyond the end
|
|
of the data, then the size of the data is increased to
|
|
accomodate the new bytes.<br>
|
|
</p>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-10">resetBytesInRange:</a></h3>
|
|
- (void) <b>resetBytesInRange:</b> (NSRange)range;<br>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-11">serializeAlignedBytesLength:</a></h3>
|
|
- (void) <b>serializeAlignedBytesLength:</b> (unsigned int)length;<br>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-12">serializeDataAt:ofObjCType:context:</a></h3>
|
|
- (void) <b>serializeDataAt:</b> (const void*)data <b>ofObjCType:</b> (const char*)type <b>context:</b> (id<NSObjCTypeSerializationCallBack>)callback;<br>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-13">serializeInt:</a></h3>
|
|
- (void) <b>serializeInt:</b> (int)value;<br>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-14">serializeInt:atIndex:</a></h3>
|
|
- (void) <b>serializeInt:</b> (int)value <b>atIndex:</b> (unsigned int)index;<br>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-15">serializeInts:</a></h3>
|
|
- (void) <b>serializeInts:</b> (int*)intBuffer;<br>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-16">serializeInts:count:atIndex:</a></h3>
|
|
- (void) <b>serializeInts:</b> (int*)intBuffer <b>count:</b> (unsigned int)numInts <b>atIndex:</b> (unsigned int)index;<br>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-17">setData:</a></h3>
|
|
- (void) <b>setData:</b> (NSData*)aData;<br>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-18">setLength:</a></h3>
|
|
- (void) <b>setLength:</b> (unsigned int)length;<br>
|
|
|
|
<p>
|
|
|
|
Sets the length of the NSMutableData object.
|
|
If the length is increased, the newly allocated data area
|
|
is filled with zero bytes.
|
|
</p>
|
|
|
|
<p>
|
|
|
|
This is a 'primitive' method ... you need to implement it
|
|
if you write a subclass of NSMutableData.
|
|
</p>
|
|
|
|
|
|
<hr>
|
|
</body>
|
|
|
|
</html>
|