// 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;
				for(i = 0; i < blockSize; ++i) {
					blockData.add(dataStack.pop());
				}
				break;
				
			//Unknown block data type
			default:
				throw new BaRMIeInvalidReplyDataPacketException("Invalid block data element type in class annotation.");
		}
		
		//Examine the block data for object endpoint details (note peeking at the block data, not the data stack)
		if(this.peekShort(blockData) == 10) {
			//The first two bytes are 0x00 0a, check for the string "UnicastRef"
			if(this.extractUtf8(blockData).equals("UnicastRef")) {
				//UnicastRef found in the block data, extract the object's host and port and add them to the object description (note extraction from block data, not data stack)
				try {
					obj.setObjectEndpoint(new TCPEndpoint(this.extractUtf8(blockData), this.extractInt(blockData)));
				} catch(BaRMIeInvalidPortException bipe) {
					throw new BaRMIeInvalidReplyDataPacketException("UnicastRef contained an invalid port number.", bipe);
				}
			}
		} else if(this.peekShort(blockData) == 11) {
			//The first two bytes are 0x00 0b, check for the string "UnicastRef2"
			if(this.extractUtf8(blockData).equals("UnicastRef2")) {
				//UnicastRef2 found in the block data, extract the object's host and port and add them to the object description
				try {
					//Skip over a byte
					blockData.pop();
					
					//Extract the host name and port
// 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;

				for(i = 0; i < blockSize; ++i) {
					blockData.add(dataStack.pop());
				}
				break;
				
			//Unknown block data type
			default:
				throw new BaRMIeInvalidReplyDataPacketException("Invalid block data element type in class annotation.");
		}
		
		//Examine the block data for object endpoint details (note peeking at the block data, not the data stack)
		if(this.peekShort(blockData) == 10) {
			//The first two bytes are 0x00 0a, check for the string "UnicastRef"
			if(this.extractUtf8(blockData).equals("UnicastRef")) {
				//UnicastRef found in the block data, extract the object's host and port and add them to the object description (note extraction from block data, not data stack)
				try {
					obj.setObjectEndpoint(new TCPEndpoint(this.extractUtf8(blockData), this.extractInt(blockData)));
				} catch(BaRMIeInvalidPortException bipe) {
					throw new BaRMIeInvalidReplyDataPacketException("UnicastRef contained an invalid port number.", bipe);
				}
			}
		} else if(this.peekShort(blockData) == 11) {
			//The first two bytes are 0x00 0b, check for the string "UnicastRef2"
			if(this.extractUtf8(blockData).equals("UnicastRef2")) {
				//UnicastRef2 found in the block data, extract the object's host and port and add them to the object description
				try {
					//Skip over a byte
					blockData.pop();
					
					//Extract the host name and port
					obj.setObjectEndpoint(new TCPEndpoint(this.extractUtf8(blockData), this.extractInt(blockData)));