#90 ByteStreamer#append

Kapalı
ranides tarafından 4 yıl önce kere açıldı · 1 yorum
ranides 4 yıl önce olarak yorumlandı

We could try to avoid allocating new array if there is enough space in current buffer.

Current "pending" fragment can be moved to the begin of the "array". New data could be copied after it.

In fact, it won't change almost anything except:

  • conditional allocation
  • storing additional field: "array_length" (which could be smaller than array.length)
We could try to avoid allocating new array if there is enough space in current buffer. Current "pending" fragment can be moved to the begin of the "array". New data could be copied after it. In fact, it won't change almost anything except: - conditional allocation - storing additional field: "array_length" (which could be smaller than array.length)
ranides 4 yıl önce olarak yorumlandı
Sahibi
this.array_size = pending + input.length;
byte[] appended = this.array_size > array.length ? new byte[alloc] : array;
``` this.array_size = pending + input.length; byte[] appended = this.array_size > array.length ? new byte[alloc] : array; ```
ranides 3 yıl önce işlemesinde bu sorunu işaret etti
Giriş yap bu konuşmaya katılmak için.
Kilometre Taşı Yok
Atanan Kişi Yok
1 Katılımcı
Yükleniyor...
İptal
Kaydet
Henüz bir içerik yok.