The other day I was working with soap attachments and stumbled across OctetStream. Had no idea on this stream type which made me lookaround and came up with this info:
org.apache.axis.attachments.OctetStream corresponds to mime type "application/octetstream"
-- Converting Inputstream to OctetStream
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int byte1 = -1;
while ((byte1 = in.read()) != -1)
baos.write(byte1);
return new OctetStream(baos.toByteArray());
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment