6. Call getOutputStream() to get an output stream object.
6. Call getOutputStream() to get an output stream object.
7. Write the byte array calculated in step 5 onto the stream.
8. Close the output stream.
9. Call getInputStream() to get an input stream object. Read from it as usual.