The interface functions to the IOBuffer object are not effected by compacting. The failure condition here is the assumption that there are no other consumers of the stream.  mark may be helpful here to validate that assumption?