public ByteBuffer toBuffer() 
	{
		short bufferSize = (short)
				(4*(4 + numberOfHeard + numberOfSymmetric));
		ByteBuffer buffer = ByteBuffer.allocate(bufferSize);
		buffer.put(MessageThread.helloType);
		buffer.put((byte) 0);
		buffer.putShort(bufferSize);
		buffer.put(sourceAddress.toBytes());
		buffer.put((byte) numberOfHeard);
		buffer.put((byte) 0);
		buffer.put((byte) 0);
		buffer.put((byte) 0);
		for (IP address : heardNeighbors) {
			buffer.put(address.toBytes());
		}
		buffer.put((byte) numberOfSymmetric);
		buffer.put((byte) 0);
		buffer.put((byte) 0);
		buffer.put((byte) 0);
		for (IP address : symmetricNeighbors) {
			buffer.put(address.toBytes());
		}
		return buffer;
	}