public void setByte ( long index , byte value ) { checkArgument ( index < bytesUsed , "Index: " + index + " is >= the current size of: " + bytesUsed ) ; long seen = 0 ; for ( int i = 0 ; i < slabs . size ( ) ; i ++ ) { ByteBuffer slab = slabs . get ( i ) ; if ( index < seen + slab . limit ( ) ) { // ok found index slab . put ( ( int ) ( index - seen ) , value ) ; break ; } seen += slab . limit ( ) ; } }
Replace the byte stored at position index in this stream with value