// Path: src/main/java/com/rapplogic/xbee/XBeeConnection.java
// public interface XBeeConnection {
// 	public OutputStream getOutputStream();
// 	public InputStream getInputStream();
// 	public void close() throws IOException; 
// }


import com.rapplogic.xbee.util.ByteUtils;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import org.apache.log4j.Logger;
import com.rapplogic.xbee.XBeeConnection;

/**
 * Copyright (c) 2008 Andrew Rapp. All rights reserved.
 *  
 * This file is part of XBee-API.
 *  
 * XBee-API is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *  
 * XBee-API is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *  
 * You should have received a copy of the GNU General Public License
 * along with XBee-API.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.rapplogic.xbee.api;




/**
 * Reads data from the input stream and hands off to PacketParser for packet parsing.
 * Notifies XBee class when a new packet is parsed
 * <p/>
 * @author andrew
 *
 */
public class InputStreamThread implements Runnable {
	
	private final static Logger log = Logger.getLogger(InputStreamThread.class);
	
	private Thread thread;
	private ExecutorService listenerPool;
	private volatile boolean done = false;

// Path: src/main/java/com/rapplogic/xbee/XBeeConnection.java
// public interface XBeeConnection {
// 	public OutputStream getOutputStream();
// 	public InputStream getInputStream();
// 	public void close() throws IOException; 
// }


// Path: src/main/java/com/rapplogic/xbee/api/InputStreamThread.java
import com.rapplogic.xbee.util.ByteUtils;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import org.apache.log4j.Logger;
import com.rapplogic.xbee.XBeeConnection;

/**
 * Copyright (c) 2008 Andrew Rapp. All rights reserved.
 *  
 * This file is part of XBee-API.
 *  
 * XBee-API is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *  
 * XBee-API is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *  
 * You should have received a copy of the GNU General Public License
 * along with XBee-API.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.rapplogic.xbee.api;




/**
 * Reads data from the input stream and hands off to PacketParser for packet parsing.
 * Notifies XBee class when a new packet is parsed
 * <p/>
 * @author andrew
 *
 */
public class InputStreamThread implements Runnable {
	
	private final static Logger log = Logger.getLogger(InputStreamThread.class);
	
	private Thread thread;
	private ExecutorService listenerPool;
	private volatile boolean done = false;

	private final XBeeConnection connection;
