     
 
     open class func unpack<T: Any>(_ valueByteArray: [Byte], toType type: T.Type, byteOrder: ByteOrder = .nativeByteOrder) -> T {
-        assert(!(T.self is AnyObject), referenceTypeErrorString)
+        //assert(!(T.self is AnyObject), referenceTypeErrorString) // does not work in Swift 3
         let bytes = (byteOrder == .littleEndian) ? valueByteArray : valueByteArray.reversed()
         return bytes.withUnsafeBufferPointer {
             return $0.baseAddress!.withMemoryRebound(to: T.self, capacity: 1) {

    }
    

    public class func pack<T: Any>(_ value: T, byteOrder: ByteOrder = .nativeByteOrder) -> [Byte] {
        var value = value
        assert(!(T.self is AnyObject), referenceTypeErrorString)
        let valueByteArray = withUnsafePointer(to: &value) {
            Array(UnsafeBufferPointer(start: $0.withMemoryRebound(to: Byte.self, capacity: 1){$0}, count: MemoryLayout<T>.size))
        }

    
    
    open class func unpack<T: Any>(_ valueByteArray: [Byte], byteOrder: ByteOrder = .nativeByteOrder) -> T {
        //assert(!(type(of: T.self) is AnyObject), referenceTypeErrorString) // does not work in Swift 3
        let bytes = (byteOrder == .littleEndian) ? valueByteArray : valueByteArray.reversed()
        return bytes.withUnsafeBufferPointer {
            return $0.baseAddress!.withMemoryRebound(to: T.self, capacity: 1) {
