def peek(f, binary, num_bytes=1):
    """Peeks num_bytes from Ark file."""
    if not binary:
        while f.peek(1)[0] == " ":
            f.read(1)
    p = f.peek(num_bytes)[:num_bytes]
    peek_bytes = len(p)
    if peek_bytes < num_bytes:
        f.read(peek_bytes)
        delta_bytes = num_bytes - peek_bytes
        p = p + f.peek(delta_bytes)[:delta_bytes]
        f.seek(-peek_bytes, 1)
    return p