NSData
super: Object
This class is reserved and cannot be directly instantiated.
Properties
-
var length: Int The number of bytes contained by the data object. (read-only)
-
var position: Int The position used for the Read and Write methods. This proprerty is automatically incremented by all of the Read and Write methods.
-
var littleEndian: Int The byte order used by the Read and Write methods. If true, values are stored with the least-significant bytes first. The default value is true.
-
var objectName: String The name of the object.
Methods
-
func readUInt8(): Int Reads a one-byte value from the data and returns it as a UInt8. See also the
position
property. -
func readUInt16(): Int Reads a two-bytes value from the data and returns it as a UInt16. See also the
position
and thelittleEndian
properties. -
func readUInt32(): Int Reads a four-bytes value from the data and returns it as a UInt32. See also the
position
and thelittleEndian
properties. -
func readUInt64(): Int Reads a eight-bytes value from the data and returns it as a UInt64. See also the
position
and thelittleEndian
properties. -
func readInt8(): Int Reads a one-byte value from the data and returns it as a Int8. See also the
position
property. -
func readInt16(): Int Reads a two-bytes value from the data and returns it as a Int16. See also the
position
and thelittleEndian
properties. -
func readInt32(): Int Reads a four-bytes value from the data and returns it as a Int32. See also the
position
and thelittleEndian
properties. -
func readInt64(): Int Reads a eight-bytes value from the data and returns it as a Int64. See also the
position
and thelittleEndian
properties. -
func readFloat(): Float Reads a four-bytes value from the data and returns it as a Float. See also the
position
and thelittleEndian
properties. -
func readDouble(): Float Reads a eight-bytes value from the data and returns it as a Double. See also the
position
and thelittleEndian
properties. -
func md5(): String Compute MD5 digest algorithm.
-
func sha1(): String Compute SHA1 digest algorithm.
-
func sha256(): String Compute SHA256 digest algorithm.
-
func sha512(): String Compute SHA512 digest algorithm.
-
func base64(): String Encode data to base64 string.