def METHOD_NAME(self):
    def read_written(self, what):
        f = io.BytesIO()
        getattr(aifc, '_write_' + what)(f, x)
        f.seek(0)
        return getattr(aifc, '_read_' + what)(f)
    for x in (-1, 0, 0.1, 1):
        self.assertEqual(read_written(x, 'float'), x)
    for x in (float('NaN'), float('Inf')):
        self.assertEqual(read_written(x, 'float'), aifc._HUGE_VAL)
    for x in (b'', b'foo', b'a' * 255):
        self.assertEqual(read_written(x, 'string'), x)
    for x in (-0x7FFFFFFF, -1, 0, 1, 0x7FFFFFFF):
        self.assertEqual(read_written(x, 'long'), x)
    for x in (0, 1, 0xFFFFFFFF):
        self.assertEqual(read_written(x, 'ulong'), x)
    for x in (-0x7FFF, -1, 0, 1, 0x7FFF):
        self.assertEqual(read_written(x, 'short'), x)
    for x in (0, 1, 0xFFFF):
        self.assertEqual(read_written(x, 'ushort'), x)