Extracting band's pixel values into a NumPy array using snappy

I’ve seen examples such as snappy_flh.py where NumPy arrays are written into a band using the writePixels method.

Using dir() on a Band object reveals two methods, getPixels and readPixels, both of which give me an error “RuntimeError: no matching Java method overloads found”. How come these methods are found by dir, but I can’t use them? How do I extract the band’s data into a NumPy array?

Can you show your code.
Maybe the parameters are not of the correct data type.