public Message(byte[] message) {
		if (message == null) {
			return;
		}
		// System.out.println(Arrays.toString(message));
		len = ((message[0] & 0xFF) << 24) | ((message[1] & 0xFF) << 16) | ((message[2] & 0xFF) << 8) | (message[3] & 0xFF);
		if (len < 0) {
			id = -2;
			return;
		}
		id = message[4] & 0xFF;
		if (id == 4) {
			index = (message[5] & 0xFF) << 24 | (message[6] & 0xFF) << 16 | (message[7] & 0xFF) << 8 | (message[8] & 0xFF);
		} else if (id == 5) {
			bitfield = new byte[len - 1];
			System.arraycopy(message, 5, bitfield, 0, len - 1);
		} else if (id == 6) {
			index = (message[5] & 0xFF) << 24 | (message[6] & 0xFF) << 16 | (message[7] & 0xFF) << 8 | (message[8] & 0xFF);
			begin = (message[9] & 0xFF) << 24 | (message[10] & 0xFF) << 16 | (message[11] & 0xFF) << 8 | (message[12] & 0xFF);
			length = (message[13] & 0xFF) << 24 | (message[14] & 0xFF) << 16 | (message[15] & 0xFF) << 8 | (message[16] & 0xFF);
		} else if (id == 7) {
			index = (message[5] & 0xFF) << 24 | (message[6] & 0xFF) << 16 | (message[7] & 0xFF) << 8 | (message[8] & 0xFF);
			begin = (message[9] & 0xFF) << 24 | (message[10] & 0xFF) << 16 | (message[11] & 0xFF) << 8 | (message[12] & 0xFF);

			System.out.println("Creating piece message with len " + len + " from message with length " + message.length);
			int bound = (len < message.length ? len : message.length);
			block = new byte[bound - 13];
			for (int i = 0; i < bound - 13; i++) {
				byte temp = message[i + 13];
				block[i] = temp;
			}
			// System.arraycopy(message, 13, block, 0, len - 9);
		}
	}