| Constructor and Description |
|---|
NSData(byte[] theData)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.io.ByteArrayInputStream |
getValue()
Get the unmodifiable value of this object.
|
boolean |
isTrue()
Return whether or not the value evaluates to true.
|
byte[] |
toBytes()
Return the contents of this object as primitive array.
|
double |
toDouble()
Return the value as a double.
|
long |
toLong()
Get the length of the content in bytes.
|
byte[] |
toObject()
Converts this NSObject to a normal Java object.
|
java.io.ByteArrayInputStream |
toStream()
Get a
ByteArrayInputStream which can be used to read the contents of this object. |
java.lang.String |
toString()
Returns an formatted hexadecimal representation of the content.
|
equals, fromObject, hashCode, toBoolean, toDate, toInteger, toList, toListObject, toMap, toMapObject, toNumberpublic NSData(byte[] theData)
theData - value of the new objectpublic java.io.ByteArrayInputStream getValue()
getValue in class NSObjecttoStream()public java.io.ByteArrayInputStream toStream()
ByteArrayInputStream which can be used to read the contents of this object.
This is the most cost-efficient way to retrieve the value contained in an NSData object.public byte[] toBytes()
Return the contents of this object as primitive array.
Because the array is copied to keep this object immutable,
it's recommended to use toStream() instead.
public byte[] toObject()
NSObject.fromObject(Object) which will convert the object back to an NSObject.
Note: This method will NOT convert NSUID objects,
because there is no Java equivalent for those.public boolean isTrue()
Return whether or not the value evaluates to true.
A value returns to true if and only if
NSBoolean type NSBoolean.TRUENSString which has a length greater than zero and does not equal "NO" or "False" (case insensitive)NSNumber greater than 0NSCollection which contains more than zero elementsNSDateNSData with a length greater than 0public java.lang.String toString()
public long toLong()