         
     }
     
-    /// Sets the buffer back to the beginning position
+    /// Sets the buffer back to the beginning position, the next fill call will take data
+    /// from the beginning of the buffer.
     public func rewind() {
         
         byteIndex = 0

    ///
    /// - Parameter array: a [UInt8] for the data you want from the buffer
    ///
    /// - Returns:
    public func fill(array: inout [UInt8]) -> Int {
        
        let result = min(array.count, localData.length - byteIndex)
        let bytes = localData.bytes.assumingMemoryBound(to: UInt8.self) + byteIndex
        UnsafeMutableRawPointer(mutating: array).copyBytes(from: bytes, count: result)
        byteIndex += result
        
        return result
        
    }
    
    /// Fill memory with data from the buffer

    ///
    /// - Parameter data: The Data struct to fill from data in the buffer
    ///
    /// - Returns: The number of bytes actually copied from the buffer. It will be equal
    ///           to the number of bytes lect in the buffer.
    public func fill(data: inout Data) -> Int {
        
        let result = localData.length - byteIndex
