write raw bytes to buffer at current writer index. Automatically grows buffer and advances writer index.
| 849 | /// write raw bytes to buffer at current writer index. |
| 850 | /// Automatically grows buffer and advances writer index. |
| 851 | FORY_ALWAYS_INLINE void write_bytes(const void *data, uint32_t length) { |
| 852 | grow(length); |
| 853 | unsafe_put(writer_index_, data, length); |
| 854 | increase_writer_index(length); |
| 855 | if (FORY_PREDICT_FALSE(output_stream_ != nullptr && writer_index_ > 4096)) { |
| 856 | output_stream_->try_flush(); |
| 857 | } |
| 858 | } |
| 859 | |
| 860 | // =========================================================================== |
| 861 | // Safe read methods with bounds checking |