Fork me on GitHub
#java
<
2018-03-29
>
jjttjj15:03:17

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.

mikerod15:03:33

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

mikerod15:03:26

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

jjttjj15:03:19

Sorry I meant this whole builder class

jjttjj15:03:58

including the ByteBuffer private class

mikerod15:03:47

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

jjttjj15:03:58

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

jjttjj15:03:10

gotcha thanks for the input though

mikerod15:03:21

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

jjttjj15:03:50

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

jjttjj15:03:24

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

mikerod15:03:35

but I haven’t used this

mikerod15:03:47

it may ease some of the byte fiddling

jjttjj15:03:02

oh cool, thanks!