public static MulticastAnnouncement decodeMulticastAnnouncement(ByteBuffer buf) throws IOException {
  try {
    long seq=buf.getLong();
    String host=getUtf(buf);
    int port=ushortToInt(buf.getShort());
    String[] groups=new String[ushortToInt(buf.getShort())];
    for (int i=0; i < groups.length; i++) {
      groups[i]=getUtf(buf);
    }
    long idhi=buf.getLong();
    long idlo=buf.getLong();
    return new MulticastAnnouncement(seq,host,port,groups,new ServiceID(idhi,idlo));
  }
 catch (  RuntimeException e) {
    throw new DiscoveryProtocolException(null,e);
  }
}

public static MulticastAnnouncement decodeMulticastAnnouncement ( ByteBuffer buf ) throws IOException { try { long seq = buf . getLong ( ) ; String host = getUtf ( buf ) ; int port = ushortToInt ( buf . getShort ( ) ) ; String [ ] groups = new String [ ushortToInt ( buf . getShort ( ) ) ] ; for ( int i = 0 ; i < groups . length ; i ++ ) { groups [ i ] = getUtf ( buf ) ; } long idhi = buf . getLong ( ) ; long idlo = buf . getLong ( ) ; return new MulticastAnnouncement ( seq , host , port , groups , new ServiceID ( idhi , idlo ) ) ; } catch ( RuntimeException e ) { throw new DiscoveryProtocolException ( null , e ) ; } }
decodes multicast announcement according to the net . jini . discovery . plaintext format .
