private void setBeaconContents(){
		
		//Calculate maximum number of peers that can be included in the packet
		//content. The subtracted 12 bytes is to account for the peer count 
		//parcel variable and also the CRC that will be added at the bottom of 
		//the final Packet.
		int maxNumPeers = (int)((Connection.MAX_PACKET_LENGTH - 12) / Peer.PARCEL_SIZE);
		
		//The actual number of peers to be included in the content is the 
		//minimum of the calculated possible maximum number of peers that could
		//be included and the actual number of peers.
		int numPeers = Math.min(maxNumPeers, peers.size());
		
		//If the maximum number of peers to be included in the beacon was 
		//specified by an environment variable, then take the minimum of the 
		//calculated value and the set value.
		if(maxBeaconPeers != null){
			numPeers = Math.min(numPeers, maxBeaconPeers);
		}
		
		//Compute the total number of bytes of a beacon parcel.
		int beaconParcelLength = numPeers * Peer.PARCEL_SIZE + 12;
		
		Parcel beaconParcel = new Parcel(beaconParcelLength);
		
		beaconParcel.add((short)numPeers);
		
		//Count of currently included peers. This value is used to cap off how
		//many peers will be included in the beacon packet.
		int includedPeers = 0;
		
	
		//Add all the neighbor peers to the beacon contents.
		for(PeerAddress address : peers.keySet()){
			beaconParcel.add(peers.get(address));
			
			//If we already added enough peers to this beacon, then exit 
			//the loop.
			if(++includedPeers > numPeers)
				break;
		}

		//Add a long value 0 as a temporary checksum.
		beaconParcel.add((long)0);
	
		super.setContents(beaconParcel);
	}