// Path: src/nb/barmie/exceptions/BaRMIeInvalidPortException.java
// public class BaRMIeInvalidPortException extends BaRMIeException {
// 	public BaRMIeInvalidPortException(int portNumber) {
// 		super("The given port number (" + portNumber + ") is not a valid TCP port number.");
// 	}
// }
// 
// Path: src/nb/barmie/exceptions/BaRMIeInvalidReplyDataPacketException.java
// public class BaRMIeInvalidReplyDataPacketException extends BaRMIeException {
// 	public BaRMIeInvalidReplyDataPacketException(String message) {
// 		super(message);
// 	}
// 	
// 	public BaRMIeInvalidReplyDataPacketException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// }
// 
// Path: src/nb/barmie/net/TCPEndpoint.java
// public class TCPEndpoint {
// 	/*******************
// 	 * Properties
// 	 ******************/
// 	private final String _host;
// 	private final int _port;
// 	
// 	/*******************
// 	 * Construct the TCP endpoint object with a given host and port.
// 	 * 
// 	 * @param host The host/IP to use.
// 	 * @param port The port to use.
// 	 * @throws nb.barmie.exceptions.BaRMIeInvalidPortException If the given port number is not a valid TCP port number.
// 	 ******************/
// 	public TCPEndpoint(String host, int port) throws BaRMIeInvalidPortException {
// 		//Store the properties
// 		this._host = host;
// 		this._port = port;
// 		
// 		//Validate the port number
// 		if(this._port < 1 || this._port > 65535) {
// 			throw new BaRMIeInvalidPortException(this._port);
// 		}
// 	}
// 	
// 	/*******************
// 	 * Return a string representation of this endpoint.
// 	 * 
// 	 * @return A host:port string.
// 	 ******************/
// 	public String toString() {
// 		return this._host + ":" + this._port;
// 	}
// 	
// 	/*******************
// 	 * Getters
// 	 ******************/
// 	public String getHost() { return this._host; }
// 	public int getPort() { return this._port; }
// }


import java.io.ObjectStreamConstants;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import nb.barmie.exceptions.BaRMIeInvalidPortException;
import nb.barmie.exceptions.BaRMIeInvalidReplyDataPacketException;
import nb.barmie.net.TCPEndpoint;
		}
	}
	
	/*******************
	 * Handle a block data element found within an object annotation.
	 * 
	 * This block of data may contain the host and port where a remote object
	 * can be accessed.
	 * 
	 * @param obj The RMIObject to populate with class names.
	 * @param dataStack The remaining data in the ReplyData packet.
	 ******************/
	private void extractObjectEndpointFromBlockData(RMIObject obj, LinkedList<Byte> dataStack) throws BaRMIeInvalidReplyDataPacketException {
		LinkedList<Byte> blockData;
		int blockSize;
		int i;
		
		//Read the block data from the stack
		blockData = new LinkedList<Byte>();
		switch(dataStack.pop()) {
			//Handle TC_BLOCKDATA elements
			case ObjectStreamConstants.TC_BLOCKDATA:
				//Read the block size and contents
				blockSize = Byte.toUnsignedInt(dataStack.pop());
				for(i = 0; i < blockSize; ++i) {
					blockData.add(dataStack.pop());
				}
				break;
				
			//Unknown block data type
// Path: src/nb/barmie/exceptions/BaRMIeInvalidPortException.java
// public class BaRMIeInvalidPortException extends BaRMIeException {
// 	public BaRMIeInvalidPortException(int portNumber) {
// 		super("The given port number (" + portNumber + ") is not a valid TCP port number.");
// 	}
// }
// 
// Path: src/nb/barmie/exceptions/BaRMIeInvalidReplyDataPacketException.java
// public class BaRMIeInvalidReplyDataPacketException extends BaRMIeException {
// 	public BaRMIeInvalidReplyDataPacketException(String message) {
// 		super(message);
// 	}
// 	
// 	public BaRMIeInvalidReplyDataPacketException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// }
// 
// Path: src/nb/barmie/net/TCPEndpoint.java
// public class TCPEndpoint {
// 	/*******************
// 	 * Properties
// 	 ******************/
// 	private final String _host;
// 	private final int _port;
// 	
// 	/*******************
// 	 * Construct the TCP endpoint object with a given host and port.
// 	 * 
// 	 * @param host The host/IP to use.
// 	 * @param port The port to use.
// 	 * @throws nb.barmie.exceptions.BaRMIeInvalidPortException If the given port number is not a valid TCP port number.
// 	 ******************/
// 	public TCPEndpoint(String host, int port) throws BaRMIeInvalidPortException {
// 		//Store the properties
// 		this._host = host;
// 		this._port = port;
// 		
// 		//Validate the port number
// 		if(this._port < 1 || this._port > 65535) {
// 			throw new BaRMIeInvalidPortException(this._port);
// 		}
// 	}
// 	
// 	/*******************
// 	 * Return a string representation of this endpoint.
// 	 * 
// 	 * @return A host:port string.
// 	 ******************/
// 	public String toString() {
// 		return this._host + ":" + this._port;
// 	}
// 	
// 	/*******************
// 	 * Getters
// 	 ******************/
// 	public String getHost() { return this._host; }
// 	public int getPort() { return this._port; }
// }


// Path: src/nb/barmie/modes/enumeration/RMIReplyDataParser.java
import java.io.ObjectStreamConstants;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import nb.barmie.exceptions.BaRMIeInvalidPortException;
import nb.barmie.exceptions.BaRMIeInvalidReplyDataPacketException;
import nb.barmie.net.TCPEndpoint;

		}
	}
	
	/*******************
	 * Handle a block data element found within an object annotation.
	 * 
	 * This block of data may contain the host and port where a remote object
	 * can be accessed.
	 * 
	 * @param obj The RMIObject to populate with class names.
	 * @param dataStack The remaining data in the ReplyData packet.
	 ******************/
	private void extractObjectEndpointFromBlockData(RMIObject obj, LinkedList<Byte> dataStack) throws BaRMIeInvalidReplyDataPacketException {
		LinkedList<Byte> blockData;
		int blockSize;
		int i;
		
		//Read the block data from the stack
		blockData = new LinkedList<Byte>();
		switch(dataStack.pop()) {
			//Handle TC_BLOCKDATA elements
			case ObjectStreamConstants.TC_BLOCKDATA:
				//Read the block size and contents
				blockSize = Byte.toUnsignedInt(dataStack.pop());
				for(i = 0; i < blockSize; ++i) {
					blockData.add(dataStack.pop());
				}
				break;
				
			//Unknown block data type
			default: