question: public byte [ ] receive ( ) throws IOException { if ( connection != null ) { packet . setLength ( DatagramConnection . DEFAULT_DATAGRAM_SIZE ) ; connection . receive ( packet ) ; int packetLength = packet . getLength ( ) ; byte [ ] data = new byte [ packetLength ] ; System . arraycopy ( packet . getData ( ) , 0 , data , 0 , packetLength ) ; return data ; } else { throw new IOException ( "Connection not openned" ) ; } }
target:  Receive data with a specific buffer size