Hi ,
I have a situation where I am reading from a stream that contains some txt part (basically xml part) and then the later part of the stream may contain a jar file or a zip file or a binary file (.exe) or a .wav file. My method takes an InputStream as param and i am able to read the xml part by using a BufferedReader. But when i am trying to read the binary part by creating a BufferedInputStream from INputStream and calling read it is always returning -1. Also i want to read everything (.zip, .jzr znd .exe etc) as a byte array and later write it out... is it possible ? I mean do i need to use ZipInputStream in order to read a zip file in order to maintain data integrity ?
I have a situation where I am reading from a stream that contains some txt part (basically xml part) and then the later part of the stream may contain a jar file or a zip file or a binary file (.exe) or a .wav file. My method takes an InputStream as param and i am able to read the xml part by using a BufferedReader. But when i am trying to read the binary part by creating a BufferedInputStream from INputStream and calling read it is always returning -1. Also i want to read everything (.zip, .jzr znd .exe etc) as a byte array and later write it out... is it possible ? I mean do i need to use ZipInputStream in order to read a zip file in order to maintain data integrity ?