# Working with rawbytes: how to remove bytes from start to given index

**URL:** <https://tech-community.robotics.abb.com/t/working-with-rawbytes-how-to-remove-bytes-from-start-to-given-index/6364>\
**Category:** RobotStudio\
**Tags:** networking, rawbytes, rapid\
**Created:** [November 8, 2014, 2:02pm UTC](https://tech-community.robotics.abb.com/t/working-with-rawbytes-how-to-remove-bytes-from-start-to-given-index/6364 "2014-11-08T14:02:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pollux](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/pollux/32/4028_2.png) [@pollux](https://tech-community.robotics.abb.com/u/pollux)\
**Post date:** [November 8, 2014, 2:02pm UTC](https://tech-community.robotics.abb.com/t/working-with-rawbytes-how-to-remove-bytes-from-start-to-given-index/6364/1 "2014-11-08T14:02:21Z")

</div>

Hi,

I’m working on a networked application where I store raw bytes into a buffer. Whenever I receive data over the network I check if there is enough bytes in the buffer for the current command. If there are enough bytes I want to parse these and remove the read data from the buffer. I see `ClearRawBytes` though this can only remove from a given index until the end. But I want to remove from the start to a given index. How can I do this?

Thanks
