How can I put multiple elements into byte[]
? I have the following 3 elements: 1) String data
, 2) String status
and 3) HashMap<String,String> headers
, which need to be passed to setContent(byte[] data)
as byte arrays. The following is the code in which I would like to use the previous 3 parameters as input for statusResult.setContent()
:
public void onSuccess(ClientResponse clientResponse){
String data=clientResponse.getMessage();
String status=String.valueOf(clientResponse.getStatus());
HashMap<String,String> headers=clientResponse.getHeaders();
// Now StatusResult is a class where we need to pass all this data,having only getters and
// setters for Content,so here in the next line i need to pass data,status and headers as
// a byte[] to setContent.
statusResult.setContent(byte[]);
}
Can somebody help me to resolve this out?