private void endFrame() {
		if (previousFrame != null) { // do not write the first frame
			if (stackMap == null) {
				stackMap = new ByteVector();
			}
			writeFrame();
			++frameCount;
		}
		previousFrame = frame;
		frame = null;
	}