Re: Is there an efficient byte buffer queue?

2018-10-16 Thread John Burton via Digitalmars-d-learn
On Sunday, 14 October 2018 at 13:07:30 UTC, Heromyth wrote: On Monday, 8 October 2018 at 09:39:55 UTC, John Burton wrote: My use case is sending data to a socket. We have ported some containers from JAVA. ByteBuffer is a basic container interface and widely used in JAVA. See also: https:/

Re: Is there an efficient byte buffer queue?

2018-10-14 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 8 October 2018 at 09:39:55 UTC, John Burton wrote: I would do much better to maintain a fixed size buffer and maintain read and write positions etc. Perhaps https://github.com/AuburnSounds/Dplug/blob/master/core/dplug/core/ringbuf.d#L16

Re: Is there an efficient byte buffer queue?

2018-10-14 Thread Heromyth via Digitalmars-d-learn
On Monday, 8 October 2018 at 09:39:55 UTC, John Burton wrote: My use case is sending data to a socket. We have ported some containers from JAVA. ByteBuffer is a basic container interface and widely used in JAVA. See also: https://github.com/huntlabs/hunt/blob/master/source/hunt/container/Byt

Re: Is there an efficient byte buffer queue?

2018-10-10 Thread Dukc via Digitalmars-d-learn
On Monday, 8 October 2018 at 10:31:33 UTC, Nicholas Wilson wrote: Try searching for "circular buffer". I'm sure http://code.dlang.org/packages/iopipe has them in some form but I can't find them with a cursory search. https://github.com/dlang-community/containers/blob/master/src/containers/cy

Re: Is there an efficient byte buffer queue?

2018-10-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/8/18 6:31 AM, Nicholas Wilson wrote: On Monday, 8 October 2018 at 09:39:55 UTC, John Burton wrote: My use case is sending data to a socket. One part of my program generates blocks of bytes, and the socket part tries to send them to the socket and then removes from the queue the number t

Re: Is there an efficient byte buffer queue?

2018-10-08 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 8 October 2018 at 09:39:55 UTC, John Burton wrote: My use case is sending data to a socket. One part of my program generates blocks of bytes, and the socket part tries to send them to the socket and then removes from the queue the number that got sent. [...] Try searching for "c

Is there an efficient byte buffer queue?

2018-10-08 Thread John Burton via Digitalmars-d-learn
My use case is sending data to a socket. One part of my program generates blocks of bytes, and the socket part tries to send them to the socket and then removes from the queue the number that got sent. I am currently using a byte[] and using concatenation and slicing to maintain the queue bu