def _tofile(self, fh, pam=False):
fh.seek(<NUM_LIT:0>)<EOL>fh.write(self._header(pam))<EOL>data = self.asarray(copy=False)<EOL>if self.maxval == <NUM_LIT:1>:<EOL><INDENT>data = numpy.packbits(data, axis=-<NUM_LIT:1>)<EOL><DEDENT>data.tofile(fh)<EOL>
Write Netbm file.