java

2018-03-29T15:20:17.000750Z

Sorry if this is a bit lazy of a question, but does anyone know of a clojure library that aids in doing the same thing this java file accomplishes, relating to building up byte arrays before writing them to DataOutputStreams: https://github.com/edouardswiac/ib-java/blob/master/src/main/java/com/ib/client/Builder.java Particularly these lines seem kind of low level: https://github.com/edouardswiac/ib-java/blob/master/src/main/java/com/ib/client/Builder.java#L77-L101 and I have a sense that there's some clojure library might accomplish the same thing but I'm not sure exactly which one.

2018-03-29T15:32:33.000150Z

@jjttjj Well, clj does have bit-and, bit-shift-left, etc

2018-03-29T15:34:26.000435Z

I’m not sure what sort of functionality you are looking for in a lib to “accomplish the same thing”. e.g. * The same thing as this project you linked or * the same as the Builder class (seems to only be a part of a larger feature) or * just this inner class that deals with byte buffers

2018-03-29T15:38:19.000758Z

Sorry I meant this whole builder class

2018-03-29T15:38:58.000105Z

including the ByteBuffer private class

2018-03-29T15:40:47.000662Z

I don’t understand enough of what it is accomplishing to have useful feedback there

2018-03-29T15:40:58.000160Z

I just got a sense that this "build up a byte array then write it to DataOutputStream" might be a sort of pattern that someone had come accross in clojure

2018-03-29T15:41:10.000276Z

gotcha thanks for the input though

2018-03-29T15:41:21.000249Z

An extension on ObjectOutput, perhaps for Java serialization or something?

2018-03-29T15:41:32.000740Z

I see

2018-03-29T15:41:50.000561Z

I think it's supposed to be something like a StringBuilder but that it builds up a byte array

2018-03-29T15:42:24.000645Z

but there is some sort of header in the byte array that must be emitted

2018-03-29T15:42:24.000668Z

maybe https://github.com/ztellman/byte-streams

2018-03-29T15:42:35.000287Z

but I haven’t used this

2018-03-29T15:42:47.000411Z

it may ease some of the byte fiddling

2018-03-29T15:43:02.000725Z

oh cool, thanks!