public class NSData extends NSObject implements NSSecureCoding
| Constructor and Description |
|---|
NSData(String base64String,
int NSDataBase64DecodingOptions)
Creates and returns the NSData object of the given base64 encoded String
with the specified options.
|
| Modifier and Type | Method and Description |
|---|---|
String |
base64EncodedStringWithOptions(int NSDataBase64EncodingOptions)
Creates a base64 encoded String according to the specified options.
|
byte[] |
bytes()
Returns a pointer to this NSData object.
|
static NSData |
dataWithBytes(byte[] data)
Creates and returns a NSData object using copied data from a buffer.
|
static NSData |
dataWithBytesNoCopy(byte[] data)
Creates and returns a NSData object generated from the bytes of a buffer.
|
static NSData |
dataWithContentsOfFile(String path)
Creates and returns a NSData object from the data of the specified file.
|
static NSData |
dataWithContentsOfURL(NSURL url)
Returns a NSData object that contains the data of the given URL.
|
int |
length()
Returns the length of this NSData object.
|
String |
toString() |
boolean |
writeToFile(String path,
boolean atomically)
Writes the bytes of this NSData to the specified file with the option of
writing first to a backup file.
|
addObserver, observeValueForKeyPath, performSelector, performSelectorOnMainThread, release, removeObserver, removeObserver, retain, setValueForKey, setValueForUndefinedKey, valueForKey, valueForUndefinedKeyequals, getClass, hashCode, notify, notifyAll, wait, wait, waitsupportsSecureCodingpublic NSData(String base64String, int NSDataBase64DecodingOptions)
base64String - The base64 encoded String.NSDataBase64DecodingOptions - The options of the encoding.public static NSData dataWithBytes(byte[] data)
data - The data of buffer.public static NSData dataWithBytesNoCopy(byte[] data)
data - The data of buffer.public static NSData dataWithContentsOfFile(String path)
path - The path of the file that is used.public static NSData dataWithContentsOfURL(NSURL url)
url - The URL of the requested data.public boolean writeToFile(String path, boolean atomically)
path - The path of the file to which the bytes will be written.atomically - TRUE then the bytes are first written to a backup file.public int length()
public byte[] bytes()
public String base64EncodedStringWithOptions(int NSDataBase64EncodingOptions)
NSDataBase64EncodingOptions - The options for the specified
encoding.Copyright © 2020. All rights reserved.