     let stream:                 InputStream
     let streamDescription:      String
     let bufferSize:             Int
+    let dataUnitSize:           Int
+    
 
     var data:                   Data
     var buffer:                 [UInt8]

        self.stream = stream
        self.encoding = encoding
        
        //make the buffer size a number aligned to 4 bytes
        self.bufferSize = Int(max(bufferSize, MINIMUM_BUFFER_SIZE) / 4) * 4
        
        self.streamDescription = description ?? stream.description
        self.firstData = true

            return nil
        }

        if let  string = String(data: data, encoding: encoding),
                string.characters.count > 0
        {
            data.removeAll()
            return string
        } else {
            var size = data.count - dataUnitSize
            while(size > 0) {
                
                if let  string = String(bytes: data[0 ..< size], encoding: encoding),
                    string.characters.count > 0
                {
                    data.removeSubrange(0 ..< size)
                    return string
                }

                size -= dataUnitSize
            }
            
        }

        return ""
    }
    
