 
   mutating func parseOne<I : IteratorProtocol>(
     _ input: inout I
-  ) -> Unicode.ParseResult<UInt32> where I.Element == CodeUnit
-
-  static func scalar(bufferStorage: UInt32, length: Int) -> UnicodeScalar
+  ) -> Unicode.ParseResult<Buffer> where I.Element == CodeUnit
+
+  static func decodeOne(_ content: Buffer) -> UnicodeScalar
 }
 
 extension UnicodeDecoder {

    } while buffer._bitCount < 32

    // Find one unicode scalar.
    // Note our empty bytes are always 0x00, which is required for this call.
    let (valid, length) = _validateBuffer()

    // Consume the decoded bytes (or maximal subpart of ill-formed sequence).
    let bitsConsumed = 8 &* length
    _sanityCheck(1...4 ~= length && bitsConsumed <= buffer._bitCount)
    let savedBuffer = buffer._storage
    
    buffer._storage = UInt32(
      // widen to 64 bits so that we can empty the buffer in the 4-byte case

extension UTF8.ReverseDecoder : _UTF8Decoder {
  public typealias CodeUnit = UInt8

  public static func decodeOne(_ encodedScalar: Buffer) -> UnicodeScalar {
    let bits = encodedScalar._storage
    /*
    if _fastPath(bits & 0x80 == 0) {
      _sanityCheck(encodedScalar.count == 1)
      _sanityCheck(bits == bits & 0xff)
      return UnicodeScalar(_unchecked: bits)
    }
    */
    
    switch encodedScalar._bitCount {
    case 8: return UnicodeScalar(_unchecked: bits)
    case 16:
      var value = bits       & 0b0______________________11_1111
      value    |= bits &>> 2 & 0b0______________0111__1100_0000
      return UnicodeScalar(_unchecked: value)
    case 24:
      var value = bits       & 0b0______________________11_1111
      value    |= bits &>> 2 & 0b0______________1111__1100_0000
      value    |= bits &>> 4 & 0b0_________1111_0000__0000_0000
      return UnicodeScalar(_unchecked: value)
    default:
      _sanityCheck(encodedScalar._bitCount == 32)
      var value = bits       & 0b0______________________11_1111
      value    |= bits &>> 2 & 0b0______________1111__1100_0000
      value    |= bits &>> 4 & 0b0_____11__1111_0000__0000_0000
      value    |= bits &>> 6 & 0b0_1_1100__0000_0000__0000_0000
      return UnicodeScalar(_unchecked: value)
    }
  }
