Can anyone tell me how to transfer/send byte[] from servlet ( C ) another servlet ( B ) , ( and finally to last servlet ( A ) )..
Connection between A, B and C is made thru HttpURLConnection.
I tried this :
To Write Form C 2 B :
ByteArrayOutputStream byteOutStream = new ByteArrayOutputStream(); byteOutStream.writeTo(response.getOutputStream()); byteOutStream.write(license FileBytes); System.out.print("licenseFile LIA : "+licenseFileBytes); byteOutStream.close();
Reading the same @ B:
byte[] licenseFile = new byte[500]; ByteArrayInputStream byteInStream = new ByteArrayInputStream (licenseFile); byteInStream = (ByteArrayInputStream)urlConn.getInputStream(); The above Reading part is throwing Exception , ClassCast Exception ..
and from here i want to write the same byte[] back to A..
Can anyone tell me how to go about doing the same. using any File IO operations..
Any help would be highly appreciated.. IS THERE ANY OTHER WAY BY WHICH I CAN PASS byte[] DATA FROM ONE SERVLET TO ANOTHER..