public void receivePackage() throws IOException {
		
		byte type = din.readByte();
		int length = din.readInt();
		
		
		switch (type) {
			case 'I':
				width = din.readInt();
				height = din.readInt();
				frameBuffer = new byte[width * height * 3];
				break;
			
			case 'A':
				byte newActive = din.readByte();
				if (active != newActive) {
					active = newActive;
					for (MLPActiveListener al : activeListeners) {
						if (active == 1) {
							al.nowActive();
						}
						else {
							al.nowInactive();
						}
					}
				}
				if (active == 1) {
					// System.out.println("Activated");
				} else {
					// System.out.println("Deactivated");
				}
				
				break;
			
			case 'R':
				for (MLPReadyListener rl : readyListeners) {
					rl.nowReady();
				}
				// System.out.println("Ready");
				break;
			
			default:
				byte data[] = new byte[length];
				din.readFully(data);
				break;
		
		}
		
		
	}