altavir
12/20/2019, 4:51 PMBytes
is not a suted to be a temporary data container due to its volatility. I still do want to be able to copy part of input to a temporary storage object which later could be read from as Input and written to output as a whole. We can certainly do it via ByteArray
, but it means additional copy on any such operation.
Instead I am thinking about following thing: we can add additional Binary reading operation into `Input`: By default it reads byte array of given length, but when read from a random-access entity like file or ByteArray
it is overwritten by method that does not copy array, but instead creates a Binary
which references initial structure and holds offset and size. Thus it could be read and written without additional copy.jimn
12/21/2019, 2:42 AM