private byte [ ] receiveBytes ( InputStream is ) throws IOException { byte [ ] buffer = new byte [ 8192 ] ; int len = ( is . read ( buffer ) ) ; if ( len < 1 ) { throw new IOException ( "receiveBytes read " + len + " bytes." ) ; } return Arrays . copyOf ( buffer , len ) ; }
Receive some bytes from the player we are requesting metadata from .