public void reparseChunkPrimitives(RandomAccessFile raff) throws IOException {
		if ((this.primitives == null) || (this.primitives.size() == 0)) {
			//nothing to do!
			return;
		}
		Primitive p = primitives.get(0).getPrimitive();		
		long oldsize = this.getDataEndPosition() - this.getDataStartPosition();
		long pos = 0;
		try {
			long newsize = p.writeValueToString().getBytes(textEncoding).length;
			boolean needsPad = false;
			if (this.getParentChunk() != null) {
				if (this.getParentChunk().usesPadByte()) {
					newsize = KlangUtil.adjustForPadByte(newsize);
					needsPad = true;
				}
			}
			long totnewsize = newsize + (this.getEndPosition() - this.getStartPosition()) - (this.getDataEndPosition() - this.getDataStartPosition());
			if (newsize < oldsize) {
				this.chunkIsAboutToChangeSize(totnewsize, raff);
				KlangUtil.deleteFromFile(this.getParentFile().getFile(), this.getDataStartPosition(), this.getDataStartPosition() + (oldsize - newsize));	
			} else if (newsize > oldsize) {
				this.chunkIsAboutToChangeSize(totnewsize, raff);
				int amt = (int)(newsize - oldsize);
				byte[] newbyte = new byte[amt];
				KlangUtil.insertIntoFile(newbyte, this.getParentFile().getFile(), this.getDataStartPosition());
			}
			//write null to pad byte
			if (needsPad) {
				raff.seek(this.getDataStartPosition() + newsize - 1);
				raff.write(0);
			}
			raff.seek(this.getDataStartPosition());
			pos = raff.getFilePointer();
			//write value back to the file
			p.writeValueToFile(raff);
		} catch (BadValueException err) {
			err.printStackTrace();
			throw new IOException(KlangConstants.ERROR_BAD_VALUE_EXCEPTION_WEIRDVALUE);
		} catch (CharacterCodingException er) {
			er.printStackTrace();
			throw new IOException(KlangConstants.ERROR_BAD_VALUE_EXCEPTION_WEIRDVALUE);
		}
		//reparse the file
		((EditableFileBase)this.getParentFile()).reparseFile(raff);
		Chunk c = KlangFile.findDeepestChunkFor(this.getParentFile().getChunks(), pos);
		c.chunkJustChanged(raff);
	}