Personally, if this is anything more than a "toy program" for personal curiousity, I'd suggest looking into using RMI.
But if you want to use a UDP stream ...
... then you need some way to tell the client how much data it receives:
1. Send a fixed-length (n bytes) block, then read exactly n bytes
2. Send a byte count, first, then the data
3. Parse the stream for some "end of data" delimiter
As far as the syntax for reading your 1-D byte stream into a 2-D int array...
you basically get to use a "for" loop