`if (!(buffer instanceof DirectBuffer)) ` sounds better to me.