Package org.robovm.apple.foundation
Class NSData
java.lang.Object
org.robovm.rt.bro.NativeObject
org.robovm.objc.ObjCObject
org.robovm.apple.foundation.NSObject
org.robovm.apple.foundation.NSData
- All Implemented Interfaces:
NSObjectProtocol,NSPropertyList,ObjCProtocol
- Direct Known Subclasses:
NSMutableData
public class NSData extends NSObject implements NSPropertyList
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNSData.NSDataPtrNested classes/interfaces inherited from class org.robovm.apple.foundation.NSObject
NSObject.Handle, NSObject.Marshaler, NSObject.NoRetainMarshaler, NSObject.NSKeyValueObserver, NSObject.NSObjectPtr, NSObject.SkipInitNested classes/interfaces inherited from class org.robovm.objc.ObjCObject
ObjCObject.ObjCObjectPtr, ObjCObject.Super -
Field Summary
Fields inherited from class org.robovm.apple.foundation.NSObject
FLAG_NO_RETAINFields inherited from class org.robovm.objc.ObjCObject
customClass -
Constructor Summary
Constructors Modifier Constructor Description NSData()NSData(byte[] bytes)NSData(ByteBuffer bytes)NSData(NSData data)protectedNSData(NSObject.Handle h, long handle)protectedNSData(NSObject.SkipInit skipInit)NSData(BytePtr bytes, int length, boolean freeWhenDone)NSData(T structData) -
Method Summary
Modifier and Type Method Description ByteBufferasByteBuffer()intcopy(byte[] buffer, int bufferOffset, int dataOffset, int count)intcopy(ByteBuffer buffer, int dataOffset, int count)NSRangefind(NSData dataToFind, NSDataSearchOptions mask, NSRange searchRange)static NSDatafromBaseEncodedData(NSData base64Data, NSDataBase64DecodingOptions options)static NSDatafromBaseEncodedString(String base64String, NSDataBase64DecodingOptions options)byte[]getBytes()protected voidgetBytes(long buffer, long length)protected longgetBytes0()longgetLength()<T extends Struct<T>>
TgetStructData(Class<T> type)NSDatagetSubdata(NSRange range)protected longinit(long bytes, long length)protected longinit(long bytes, long length, boolean b)protected longinit(String base64String, NSDataBase64DecodingOptions options)protected longinit(NSData data)protected longinit(NSData base64Data, NSDataBase64DecodingOptions options)static NSDataread(File file)static NSDataread(File file, NSDataReadingOptions readOptionsMask)static NSDataread(NSURL url)static NSDataread(NSURL url, NSDataReadingOptions readOptionsMask)protected static NSDatareadFile(String path)protected static NSDatareadFile(String path, NSDataReadingOptions readOptionsMask)static NSDatareadMapped(File file)Deprecated.Deprecated in iOS 8.0.protected static NSObjectreadMappedFile(String path)Deprecated.Deprecated in iOS 8.0.NSDatatoBase64EncodedData(NSDataBase64EncodingOptions options)StringtoBase64EncodedString(NSDataBase64EncodingOptions options)voidwrite(File file, boolean useAuxiliaryFile)voidwrite(File file, NSDataWritingOptions writeOptionsMask)booleanwrite(NSURL url, boolean atomically)booleanwrite(NSURL url, NSDataWritingOptions writeOptionsMask)protected booleanwriteFile(String path, boolean atomically)protected booleanwriteFile(String path, NSDataWritingOptions writeOptionsMask)Methods inherited from class org.robovm.apple.foundation.NSObject
addKeyValueObserver, addKeyValueObserver, afterMarshaled, alloc, autorelease, autorelease, awakeFromNib, conformsToProtocol, copy, description, didChangeValue, didChangeValue, didChangeValues, doDispose, equals, forceSkipInit, getAutoContentAccessingProxy, getClassForCoder, getClassForKeyedArchiver, getKeyValueCoder, getObservationInfo, hash, hashCode, init, isEqual, isKindOfClass, isMemberOfClass, mutableCopy, performSelector, performSelector, performSelector, performSelector, performSelector, performSelector, performSelector, performSelectorInBackground, performSelectorOnMainThread, performSelectorOnMainThread, performSelectorV, performSelectorV, performSelectorV, release, release, removeKeyValueObserver, removeKeyValueObservers, respondsToSelector, retain, retain, retainCount, setObservationInfo, toString, willChangeValue, willChangeValue, willChangeValuesMethods inherited from class org.robovm.objc.ObjCObject
addStrongRef, dispose, dispose, finalize, getAssociatedObject, getObjCClass, getPeerObject, getSuper, initObject, logRetainRelease, removeStrongRef, retainCustomObjectFromCb, setAssociatedObject, toObjCObject, toObjCObject, updateStrongRefMethods inherited from class org.robovm.rt.bro.NativeObject
as, getHandle, setHandle
-
Constructor Details
-
NSData
public NSData() -
NSData
-
NSData
-
NSData
-
NSData
public NSData(byte[] bytes) -
NSData
-
NSData
-
NSData
public NSData(T structData)
-
-
Method Details
-
getLength
public long getLength() -
getBytes0
protected long getBytes0() -
asByteBuffer
-
getBytes
public byte[] getBytes() -
copy
-
copy
public int copy(byte[] buffer, int bufferOffset, int dataOffset, int count) -
getStructData
-
fromBaseEncodedData
-
fromBaseEncodedString
public static NSData fromBaseEncodedString(String base64String, NSDataBase64DecodingOptions options) -
read
- Throws:
NSErrorException
-
read
-
readMapped
Deprecated.Deprecated in iOS 8.0.- Since:
- Available in iOS 2.0 and later.
-
write
-
write
- Throws:
NSErrorException
-
getBytes
protected void getBytes(long buffer, long length) -
getSubdata
-
writeFile
-
write
-
writeFile
protected boolean writeFile(String path, NSDataWritingOptions writeOptionsMask) throws NSErrorException- Throws:
NSErrorException
-
write
- Throws:
NSErrorException
-
find
-
init
protected long init(long bytes, long length) -
init
protected long init(long bytes, long length, boolean b) -
init
-
readFile
protected static NSData readFile(String path, NSDataReadingOptions readOptionsMask) throws NSErrorException- Throws:
NSErrorException
-
read
- Throws:
NSErrorException
-
readFile
-
read
-
init
-
toBase64EncodedString
-
init
-
toBase64EncodedData
-
readMappedFile
Deprecated.Deprecated in iOS 8.0. Use +dataWithContentsOfURL:options:error: and NSDataReadingMappedIfSafe or NSDataReadingMappedAlways instead.
-