NSData


super: Object

This class is reserved and cannot be directly instantiated.

Events

  • None

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.

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 the littleEndian properties.

  • func readUInt32(): Int Reads a four-bytes value from the data and returns it as a UInt32. See also the position and the littleEndian properties.

  • func readUInt64(): Int Reads a eight-bytes value from the data and returns it as a UInt64. See also the position and the littleEndian 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 the littleEndian properties.

  • func readInt32(): Int Reads a four-bytes value from the data and returns it as a Int32. See also the position and the littleEndian properties.

  • func readInt64(): Int Reads a eight-bytes value from the data and returns it as a Int64. See also the position and the littleEndian properties.

  • func readFloat(): Float Reads a four-bytes value from the data and returns it as a Float. See also the position and the littleEndian properties.

  • func readDouble(): Float Reads a eight-bytes value from the data and returns it as a Double. See also the position and the littleEndian 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.