@@ -76,6 +76,7 @@ struct MBDBRecord {
76
76
let properties_count = buffer. readInteger ( endianness: . big, as: UInt8 . self) !
77
77
78
78
/*
79
+ print("###")
79
80
print("domainlen \(domain_len) domain \(domain)")
80
81
print("filenamelen \(filename_len) filename \(filename)")
81
82
print("linklen \(link_len) link \(link)")
@@ -122,14 +123,17 @@ struct MBDBRecord {
122
123
}
123
124
var buffer = ByteBufferAllocator ( ) . buffer ( capacity: capacity)
124
125
125
- buffer. writeInteger ( Int16 ( domain. count) , endianness: . big, as: Int16 . self)
126
- buffer. writeString ( domain)
126
+ let domainData = domain. data ( using: . utf8) !
127
+ buffer. writeInteger ( Int16 ( domainData. count) , endianness: . big, as: Int16 . self)
128
+ buffer. writeData ( domainData)
127
129
128
- buffer. writeInteger ( Int16 ( filename. count) , endianness: . big, as: Int16 . self)
129
- buffer. writeString ( filename)
130
+ let filenameData = filename. data ( using: . utf8) !
131
+ buffer. writeInteger ( Int16 ( filenameData. count) , endianness: . big, as: Int16 . self)
132
+ buffer. writeData ( filenameData)
130
133
131
- buffer. writeInteger ( Int16 ( link. count) , endianness: . big, as: Int16 . self)
132
- buffer. writeString ( link)
134
+ let linkData = link. data ( using: . utf8) !
135
+ buffer. writeInteger ( Int16 ( linkData. count) , endianness: . big, as: Int16 . self)
136
+ buffer. writeData ( linkData)
133
137
134
138
buffer. writeInteger ( Int16 ( hash. count) , endianness: . big, as: Int16 . self)
135
139
buffer. writeData ( hash)
0 commit comments