I am trying to encoding a large data(2.5MB) with URLEncoder class. But there is not output from the class,i.e. String. Is there any restriction for the size of data Encoding with this class. Has anyone come across this problem?
You didn't mention why you were trying to do this. The only reason to URL encode something is to be able to use it as part of a URL. Now, if you are trying to pass a 2.5M string as a request parameter encoded in the query string of a URL as part of a GET, well, that's way too large. What exactly are you trying to accomplish? bear
I am trying to do this to send the data over the wire, to another servlet with HttpUrlConnection . I am transmitting this data after establishing a connection with this remote servlet, for that reason I have to encode this data using URLEncoder.
mandar, I'm not really sure you need to use URLEncoder. If the 2.5MB file you are sending has a ' ' (space) character in it, does it make sense to turn this into a '+' character? You'd only have to use URLDecoder at the other end. Maybe it's a requirement to encode anything going over HTTP, but I thought that sending files as a stream of bytes "as is" was acceptable.