       return cbfn null, wasAltered, output
   
   @correctStream: (contentStream, optionMap)->
-    { eolc } = LineEndingCorrector.__extractOptions optionMap
-    return new LineEndingCorrector.__CorrectedStream contentStream, eolc
-
-
-    
+    { eolc, encoding } = LineEndingCorrector.__extractOptions optionMap
+    return new LineEndingCorrector.__CorrectedStream contentStream, eolc, encoding
 
 @LineEndingCorrector = LineEndingCorrector
+


class __CorrectedStream extends Readable

  constructor: (@contentStream, @eolc)->
    super()

    hasEneded = false

      @contentStream.on 'data', (chunk)=>
        unless hasEneded
          [ _, chunk] = LineEndingCorrector.__correct chunk, @eolc
          @push chunk, @providedEncoding

      @contentStream.on 'end', =>
        unless hasEneded
          @push null
        hasEneded = true

    @setEncoding @providedEncoding

  _read: (n)=> null


class LineEndingCorrector
  
