let $X$ be a normal projective curve over field $k$. let $Z=\sum_{x \text{ closed}} n_x [x]$ be a $0$-cycle on $X$ and $D \in Div(X)$ a Cartier divisor such that $[D]=Z$. then $D$ gives rise for a line bundle $\mathcal{O}_X(D)$. I'm looking for a reference or sketch of the proof of this identity
$$H^0(X, \mathcal{O}_X(D))=\{f\in K(X)^*: \mbox{mult}_x(f)+n_x\geq 0\}\cup \{0\}.$$