this.fileInfoList.readStream( messageBuffer ); this.requestFileInfoList();
	private void decodeMessage( short opcode, MessageBuffer messageBuffer ) throws IOException 		{		switch ( opcode ) {			case Message.R_COREPROTOCOL :									/*					 *	PayLoad:					 *	int32	The maximal protocol version accepted by the core 					 */					coreProtocol = messageBuffer.readInt32();					/* send a request for FileInfoList */										this.requestFileInfoList();															break;			case Message.R_OPTIONS_INFO :									/*					 *	PayLoad:					 *	List of (String,String)	The list of options with their current value 					 */					break;							case Message.R_FILE_UPDATE_AVAILABILITY :									/*					 *	PayLoad:					 *	int32	File Number					 *	int32	client_num					 *	String	Availability									 */					break;							case Message.R_FILE_ADD_SOURCE :									/*					 *	PayLoad:					 *	int32	The File Identifier 					 *	int32	The Source/Client Identifier 					 */					this.fileAddSources.readStream( messageBuffer );					break;						case Message.R_BAD_PASSWORD :					/*					 * No Payload:					 * Just display a message and stop receiving					 */					System.out.println("Bad Password");											this.disconnect();					break;								case Message.R_CLIENT_STATS :									/*					 *	PayLoad:					 *	int64	Total uploaded 					 *	int64	Total downloaded 					 *	int64	Total shared 					 *	int32	Number of shared files 					 *	int32	Tcp Upload Rate 					 *	int32	Tcp Download Rate 					 *	int32	Udp Upload Rate 					 *	int32	Udp Download Rate 					 *	int32	Number of current downloads 					 *	int32	Number of downloads finished 					 *	List of int32  	 Connected Networks 					 */					clientStats.readStream( messageBuffer );					System.out.println(clientStats.toString() );					break;							case Message.R_CONSOLE :									/*					 *	PayLoad:					 *	String	Data, the core wants to be displayed on the console 					 */					String payloadText = messageBuffer.readString();					System.out.println( payloadText );					break;							case Message.R_NETWORK_INFO :									/*					 *	PayLoad:					 *	int32	Network identifier (used in other messages for this network) 					 *	String	Network name 					 *	int8	Enabled(1) or Disabled(0) 					 *	String	Name of network config file 					 *	int64	Number of bytes uploaded on network 					 *	int64	Number of bytes downloaded on network 					 */					int identifier;					int stringlength;					long upload;					long download;					String networkName;					String networkConfig;					boolean status;					/*					 * Here is the right place to create the Network-Classes IMHO					 * (not yet implemented)					 */					//get network_indetifier from payload:					identifier = ( int ) messageBuffer.readInt32();					//get network_name from payload:					networkName = messageBuffer.readString();					//get enabled|disabled from payload:												if ( messageBuffer.readByte() == 1 ) {						status = true;					} else {						status = false;					}					//Now follows the decoding of network_config												networkConfig = messageBuffer.readString();					//Some up / download-stats:					upload = messageBuffer.readInt64();					download = messageBuffer.readInt64();					break;								case Message.R_DOWNLOADING_LIST :					/*					 * Payload:					 * a List of running Downloads (FileInfo)					 */					 this.fileInfoList.readStream( messageBuffer );					 this.requestFileInfoList();					 break;					 			case Message.R_DOWNLOADED_LIST :					/*					 * Payload:					 * a List of complete Downloads (FileInfo)					 */					 break;		 			default :									System.out.println( "unknown OP-Code : " + opcode + "!" );					break;						}	}