Given the function $f ( x ) = \log _ { 2 } \left( x ^ { 2 } + a \right)$. If $f ( 3 ) = 1$, then $a = $ \_\_\_\_