net.wotonomy.foundation
Class NSMutableData

java.lang.Object
  extended by net.wotonomy.foundation.NSData
      extended by net.wotonomy.foundation.NSMutableData

public class NSMutableData
extends NSData

A pure java implementation of NSMutableData, which is basically an editable wrapper for a byte array.

Version:
$Revision: 892 $
Author:
michael@mpowers.net, $Author: cgruber $

Field Summary
 
Fields inherited from class net.wotonomy.foundation.NSData
bytes, EmptyData
 
Constructor Summary
NSMutableData()
          Default constructor creates a zero-data object.
NSMutableData(int size)
          Creates an object containing the specified number of bytes initialized to all zeroes.
NSMutableData(NSData aData)
          Creates an object containing a copy of the contents of the specified NSData object.
NSMutableData(java.net.URL aURL)
          Creates an object containing the contents of the specified URL.
 
Method Summary
 void appendByte(byte b)
           
 void appendBytes(byte[] b)
           
 void appendData(NSData aData)
          Appends the specified data to the end of this data.
 void increaseLengthBy(int increment)
          Increases the size of the byte array by the specified amount.
 void resetBytesInRange(NSRange aRange)
          Sets the bytes in the array within the specified range to zero.
 void setData(NSData aData)
          Copies the data in the specified object to this object, completely replacing the previous contents.
 void setLength(int length)
          Sets the length of the data to the specified length.
 
Methods inherited from class net.wotonomy.foundation.NSData
bytes, bytes, dataWithContentsOfMappedFile, isEqual, isEqualToData, length, subdataWithRange, toString, writeToURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NSMutableData

public NSMutableData()
Default constructor creates a zero-data object.


NSMutableData

public NSMutableData(java.net.URL aURL)
Creates an object containing the contents of the specified URL.


NSMutableData

public NSMutableData(NSData aData)
Creates an object containing a copy of the contents of the specified NSData object.


NSMutableData

public NSMutableData(int size)
Creates an object containing the specified number of bytes initialized to all zeroes.

Method Detail

setLength

public void setLength(int length)
Sets the length of the data to the specified length. If shorter, the data is truncated. If longer, the extra bytes are initialized to zeroes.


appendData

public void appendData(NSData aData)
Appends the specified data to the end of this data.


appendByte

public void appendByte(byte b)

appendBytes

public void appendBytes(byte[] b)

increaseLengthBy

public void increaseLengthBy(int increment)
Increases the size of the byte array by the specified amount.


resetBytesInRange

public void resetBytesInRange(NSRange aRange)
Sets the bytes in the array within the specified range to zero.


setData

public void setData(NSData aData)
Copies the data in the specified object to this object, completely replacing the previous contents.



Copyright © 2006 null. All Rights Reserved.