public void decode(Buffer stream, Envelope envelope) {
		int count = stream.getUnsignedByte();
		pairCount[0] = count >> 4;
		pairCount[1] = count & 0xf;
		if (count != 0) {
			unity[0] = stream.getUnsignedLEShort();
			unity[1] = stream.getUnsignedLEShort();
			int migrated = stream.getUnsignedByte();
			for (int direction = 0; direction < 2; direction++) {
				for (int pair = 0; pair < pairCount[direction]; pair++) {
					pairPhase[direction][0][pair] = stream.getUnsignedLEShort();
					pairMagnitude[direction][0][pair] = stream
							.getUnsignedLEShort();
				}

			}

			for (int direction = 0; direction < 2; direction++) {
				for (int pair = 0; pair < pairCount[direction]; pair++)
					if ((migrated & 1 << direction * 4 << pair) != 0) {
						pairPhase[direction][1][pair] = stream
								.getUnsignedLEShort();
						pairMagnitude[direction][1][pair] = stream
								.getUnsignedLEShort();
					} else {
						pairPhase[direction][1][pair] = pairPhase[direction][0][pair];
						pairMagnitude[direction][1][pair] = pairMagnitude[direction][0][pair];
					}

			}

			if (migrated != 0 || unity[1] != unity[0])
				envelope.decodeShape(stream);
		} else {
			unity[0] = unity[1] = 0;
		}
	}