 
     public var remaining: BufferType {
         return BufferType(start: buffer.baseAddress + current, count: buffer.count - current)
+    }
+
+    public var atEnd: Bool {
+        return current == buffer.endIndex
     }
 
     private var currentPointer: UnsafePointer <Void> {


public extension DataScanner {

    func scan(value: UInt8) throws -> Bool {
        if let scannedValue: UInt8 = try scan() {
            return scannedValue == value

        return string as String
    }

    func scanUpTo(byte: UInt8) throws -> UnsafeBufferPointer <UInt8>? {
        let start = current
        let buffer:UnsafeBufferPointer <UInt8> = self.buffer.toUnsafeBufferPointer()
