how to use ByteArrayOutputStream and DataOutputStream simultaneously (Java)

后端 未结 6 691
花落未央
花落未央 2020-12-14 22:54

I\'m having quite a problem here, and I think it is because I don\'t understand very much how I should use the API provided by Java.

I need to write an int

6条回答
  •  庸人自扰
    2020-12-14 23:12

    You don´t need more like this

    Example exampleExample = method(example); 
    ByteArrayOutputStream baos = new ByteArrayOutputStream(); marshaller.marshal(exampleExample , baos);
    Message message = MessageBuilder.withBody(baos.toByteArray()).build();
    

提交回复
热议问题