public function read($byteCount, $allowIncomplete = false)
    {
        $maxByteCount = $this->getRemainingByteCount();
        if (!$allowIncomplete && $maxByteCount < $byteCount) {
            throw new Exception\UnderflowException('The source doesn\'t have enough remaining data to fulfill the request');
        }

        $byteCount = max(min($byteCount, $maxByteCount), 0);
        $substr = substr($this->data, $this->offset, $byteCount);
        $this->moveCursor($substr);

        return $substr;
    }