• Advertisement

Archived

This topic is now archived and is closed to further replies.

[java] Byte array

This topic is 5154 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Need a way to set(reset) a byte array to 0. I used this but didn''t compile...
import java.lang.reflect.*;

for (int i=0;i<256;i++){
    Array.setByte(inbuffer,i,0x00);
} 

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
What''s wrong with the following obvious approach?


for (int i = 0; i < inbuffer.length; i++) inbuffer[i] = 0;

Share this post


Link to post
Share on other sites

  • Advertisement