posted 13 years ago
I am trying to convert int to a byte array with the code below
I am getting a BufferOverflowException, if I allocate one byte for 2. Isn't it supposed to take only 1 byte? Unless I allocate 4 bytes, it gives the exception (even if I allocate 2 or 3 bytes). This might be something very simple and I might have asked a pretty silly question. But, what am I missing here?