@@ -0,0 +1,1105 @@
+package com.lightbulbz.net;%0A%0Aimport java.io.IOException;%0Aimport java.net.*;%0A%0A/**%0A * Created by kevin on 6/3/15.%0A */%0Apublic class WOLPacketSender %7B%0A    private static final byte FF = (byte) 0xff;%0A    private static final byte%5B%5D PAYLOAD_START = %7BFF, FF, FF, FF, FF, FF%7D;%0A    private static final int WOL_PACKET_SIZE = 6 + 16 * 6;%0A    private DatagramPacket packet;%0A    private final DatagramSocket sock;%0A%0A    public WOLPacketSender(InetAddress targetAddr, MacAddress targetMac) throws SocketException %7B%0A        sock = new DatagramSocket();%0A        byte%5B%5D packetBytes = new byte%5BWOL_PACKET_SIZE%5D;%0A        byte%5B%5D macBytes = targetMac.getAddressBytes();%0A        System.arraycopy(PAYLOAD_START, 0, packetBytes, 0, PAYLOAD_START.length);%0A        for (int i = PAYLOAD_START.length; i %3C WOL_PACKET_SIZE; i += macBytes.length) %7B%0A            System.arraycopy(macBytes, 0, packetBytes, i, macBytes.length);%0A        %7D%0A        packet = new DatagramPacket(packetBytes, packetBytes.length, new InetSocketAddress(targetAddr, 9));%0A    %7D%0A%0A    public void sendPacket() throws IOException %7B%0A        sock.send(packet);%0A    %7D%0A%7D%0A

Move code to send WOL packet into library