delete flag for ByteArrayRef

we are using id to generate events (e.g. deleteEvent). When id is set to null we are not able to generate events.