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
,org.robovm.objc.ObjCProtocol
- Direct Known Subclasses:
NSMutableData
public class NSData extends NSObject implements NSPropertyList
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NSData.NSDataPtr
-
Nested classes/interfaces inherited from class org.robovm.apple.foundation.NSObject
NSObject.Handle, NSObject.Marshaler, NSObject.NoRetainMarshaler, NSObject.NSKeyValueObserver, NSObject.NSObjectPtr, NSObject.SkipInit
-
-
Field Summary
-
Fields inherited from class org.robovm.apple.foundation.NSObject
FLAG_NO_RETAIN
-
-
Constructor Summary
Constructors Modifier Constructor Description NSData()
NSData(byte[] bytes)
NSData(java.nio.ByteBuffer bytes)
NSData(NSData data)
protected
NSData(NSObject.Handle h, long handle)
protected
NSData(NSObject.SkipInit skipInit)
NSData(org.robovm.rt.bro.ptr.BytePtr bytes, int length, boolean freeWhenDone)
NSData(T structData)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.nio.ByteBuffer
asByteBuffer()
int
copy(byte[] buffer, int bufferOffset, int dataOffset, int count)
int
copy(java.nio.ByteBuffer buffer, int dataOffset, int count)
NSRange
find(NSData dataToFind, NSDataSearchOptions mask, NSRange searchRange)
static NSData
fromBaseEncodedData(NSData base64Data, NSDataBase64DecodingOptions options)
static NSData
fromBaseEncodedString(java.lang.String base64String, NSDataBase64DecodingOptions options)
byte[]
getBytes()
protected void
getBytes(long buffer, long length)
protected long
getBytes0()
long
getLength()
<T extends org.robovm.rt.bro.Struct<T>>
TgetStructData(java.lang.Class<T> type)
NSData
getSubdata(NSRange range)
protected long
init(long bytes, long length)
protected long
init(long bytes, long length, boolean b)
protected long
init(java.lang.String base64String, NSDataBase64DecodingOptions options)
protected long
init(NSData data)
protected long
init(NSData base64Data, NSDataBase64DecodingOptions options)
static NSData
read(java.io.File file)
static NSData
read(java.io.File file, NSDataReadingOptions readOptionsMask)
static NSData
read(NSURL url)
static NSData
read(NSURL url, NSDataReadingOptions readOptionsMask)
protected static NSData
readFile(java.lang.String path)
protected static NSData
readFile(java.lang.String path, NSDataReadingOptions readOptionsMask)
static NSData
readMapped(java.io.File file)
Deprecated.Deprecated in iOS 8.0.protected static NSObject
readMappedFile(java.lang.String path)
Deprecated.Deprecated in iOS 8.0.NSData
toBase64EncodedData(NSDataBase64EncodingOptions options)
java.lang.String
toBase64EncodedString(NSDataBase64EncodingOptions options)
void
write(java.io.File file, boolean useAuxiliaryFile)
void
write(java.io.File file, NSDataWritingOptions writeOptionsMask)
boolean
write(NSURL url, boolean atomically)
boolean
write(NSURL url, NSDataWritingOptions writeOptionsMask)
protected boolean
writeFile(java.lang.String path, boolean atomically)
protected boolean
writeFile(java.lang.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, willChangeValues
-
-
-
-
Constructor Detail
-
NSData
public NSData()
-
NSData
protected NSData(NSObject.Handle h, long handle)
-
NSData
protected NSData(NSObject.SkipInit skipInit)
-
NSData
public NSData(NSData data)
-
NSData
public NSData(byte[] bytes)
-
NSData
public NSData(java.nio.ByteBuffer bytes)
-
NSData
public NSData(org.robovm.rt.bro.ptr.BytePtr bytes, int length, boolean freeWhenDone)
-
NSData
public NSData(T structData)
-
-
Method Detail
-
getLength
public long getLength()
-
getBytes0
protected long getBytes0()
-
asByteBuffer
public java.nio.ByteBuffer asByteBuffer()
-
getBytes
public byte[] getBytes()
-
copy
public int copy(java.nio.ByteBuffer buffer, int dataOffset, int count)
-
copy
public int copy(byte[] buffer, int bufferOffset, int dataOffset, int count)
-
getStructData
public <T extends org.robovm.rt.bro.Struct<T>> T getStructData(java.lang.Class<T> type)
-
fromBaseEncodedData
public static NSData fromBaseEncodedData(NSData base64Data, NSDataBase64DecodingOptions options)
-
fromBaseEncodedString
public static NSData fromBaseEncodedString(java.lang.String base64String, NSDataBase64DecodingOptions options)
-
read
public static NSData read(java.io.File file, NSDataReadingOptions readOptionsMask) throws NSErrorException
- Throws:
NSErrorException
-
read
public static NSData read(java.io.File file)
-
readMapped
@Deprecated public static NSData readMapped(java.io.File file)
Deprecated.Deprecated in iOS 8.0.- Since:
- Available in iOS 2.0 and later.
-
write
public void write(java.io.File file, boolean useAuxiliaryFile)
-
write
public void write(java.io.File file, NSDataWritingOptions writeOptionsMask) throws NSErrorException
- Throws:
NSErrorException
-
getBytes
protected void getBytes(long buffer, long length)
-
writeFile
protected boolean writeFile(java.lang.String path, boolean atomically)
-
write
public boolean write(NSURL url, boolean atomically)
-
writeFile
protected boolean writeFile(java.lang.String path, NSDataWritingOptions writeOptionsMask) throws NSErrorException
- Throws:
NSErrorException
-
write
public boolean write(NSURL url, NSDataWritingOptions writeOptionsMask) throws NSErrorException
- Throws:
NSErrorException
-
find
public NSRange find(NSData dataToFind, NSDataSearchOptions mask, NSRange searchRange)
- Since:
- Available in iOS 4.0 and later.
-
init
protected long init(long bytes, long length)
-
init
protected long init(long bytes, long length, boolean b)
-
init
protected long init(NSData data)
-
readFile
protected static NSData readFile(java.lang.String path, NSDataReadingOptions readOptionsMask) throws NSErrorException
- Throws:
NSErrorException
-
read
public static NSData read(NSURL url, NSDataReadingOptions readOptionsMask) throws NSErrorException
- Throws:
NSErrorException
-
readFile
protected static NSData readFile(java.lang.String path)
-
init
protected long init(java.lang.String base64String, NSDataBase64DecodingOptions options)
- Since:
- Available in iOS 7.0 and later.
-
toBase64EncodedString
public java.lang.String toBase64EncodedString(NSDataBase64EncodingOptions options)
- Since:
- Available in iOS 7.0 and later.
-
init
protected long init(NSData base64Data, NSDataBase64DecodingOptions options)
- Since:
- Available in iOS 7.0 and later.
-
toBase64EncodedData
public NSData toBase64EncodedData(NSDataBase64EncodingOptions options)
- Since:
- Available in iOS 7.0 and later.
-
readMappedFile
@Deprecated protected static NSObject readMappedFile(java.lang.String path)
Deprecated.Deprecated in iOS 8.0. Use +dataWithContentsOfURL:options:error: and NSDataReadingMappedIfSafe or NSDataReadingMappedAlways instead.- Since:
- Available in iOS 2.0 and later.
-
-