         range.location = position
         range.length = length
         
-        let data = self.data.subdataWithRange(range)
-        position += range.length
-        
-        var buffer = NSMutableData()
-        if offset >= bytes.length
-        {
-            buffer.appendData(bytes.data)
-            if offset > bytes.length
-            {
-                var padding = [UInt8](count: offset - bytes.length, repeatedValue: 0)
-                buffer.appendBytes(&padding, length: padding.count)
-            }
-            
-            buffer.appendData(data)
-        }
-        else
-        {
-            let head = bytes.data.subdataWithRange(NSRange(location: 0, length: offset))
-            buffer.appendData(head)
-            buffer.appendData(data)
-            if offset + length < bytes.length
-            {
-                let tail = bytes.data.subdataWithRange(NSRange(location: offset + length, length: bytes.length - (offset + length)))
-                buffer.appendData(tail)
-            }
-        }
-        
-        bytes.data = buffer
+        var list = [UInt8](count: range.length, repeatedValue: 0)
+        data.getBytes(&list, range: range)
+        position += range.length
+        
+        var bin = bytes.data
+        if offset > bytes.length
+        {
+            var zero = 0
+            bin.replaceBytesInRange(NSRange(location: bytes.length, length: offset - bytes.length), withBytes: &zero)
+        }
+        
+        bin.replaceBytesInRange(NSRange(location: offset, length: length), withBytes: &list)
     }
     
     func readUTF()->String

            value = value.bigEndian
        }
        
        let num = 8
        data.appendBytes(&value, length: num)
        position += num
    }
    
    func writeUTF(var value:String)

            value = value.bigEndian
        }
        
        range.location = position
        range.length = 4
        
        data.replaceBytesInRange(range, withBytes: &value)
        position += range.length
    }
    
    func writeUInt64(var value:UInt64)
