inputstream

How to store large blobs in an android content provider?

I have some large files (images and video) which I need to store in a content provider. The android documentation indicates... If you are exposing byte data that's too big to put in the table itself — such as a large bitmap file — the field that exposes the data to clients should actually contain a content: URI string. This...

iOS: FTP TLS Connection

I need a FTP TLS Connection for my iPhone-App. A normal FTP-Connection works fine. But I need also a secure TLS connection. I used the code from Apple´s SimpleFTPSample for the iPhone: ftpStream = CFReadStreamCreateWithFTPURL(NULL, (CFURLRef) url); self.networkStream = (NSInputStream *) ftpStream; [self.networkStream retain]; self.netw...

Problem in converting InputStream to String

I have created a java program which acts as Rest Web Server. It gets the http request and send response. I am getting the http request as Input Stream inside my server. I want to convert this Input stream to String and then want to parse string according to some predefined pattern. The problem is when I get the input Stream and tries to ...

How to reuse / reset an ZipInputStream?

I want to reset the ZipInputStream (ie back to the start position) in order to read certain files in order. How do I do that? I am so stucked... ZipEntry entry; ZipInputStream input = new ZipInputStream(fileStream);//item.getInputStream()); int check =0; while(check!=2){ entry = input.getNextEnt...

Apache HttpClient api, reading response intput stream is very slow

I am using Apache HttpClient. my code looks like this HttpClient httpClient = new DefaultHttpClient(); HttpGet httpGet = new HttpGet(uri); HttpResponse response = httpClient.execute(httpGet); InputStream is = response.getEntity().getContent(); File file = new File("filename.txt...

Java: merging InputStreams

Hello there, fellow members. I goal to create (or use existing) an InputStream implementation (say, MergeInputStream), that will try to read from a multiple InputStreams and return the first result. After that it will release block and stop reading from all InputStreams until next mergeInputStream.read() call. I was quite surprised, that...

Java's readInt() equivalent in C?

In one side I have a Java client writing ints into its outputstream: int a = 20; dataout.writeInt(a); dataout.flush(); From the other side I have a C server listening the connection: int client = accept(...); How to read the int sent by Java? If I had a Java server, i could easily write: int a = dataIn.readInt(); How to do this in C...

Closing Java InputStreams

Good afternoon all. I have some questions about the usage of the close() method when using Java InputStreams. From what I see and read from most developers, you should always explicitly call close() on an InputStream when it is no longer needed. But, today I was looking into using a Java properties file, and every example I have found...

Android - Dynamic Picture loading troubles

Hi everyone! I'm currently trying to create a gallery of pictures loaded from Internet. I'm using a standard Gallery object, with a custom adapter and a custom ImageView. Everything is working quite fine, expect for the pictures downloading. I'm using an asynchronous task to do this (I have thumbnails displaying while loading). It's ...

Getting Spaces to Play Nicely with C++ Input Streams

First consider this sample C++ code: std::string input1, input2, input3; std::cout << "Enter Input 1: "; std::cin >> input1; std::cout << std::endl << "Enter Input 2: "; std::cin >> input2; std::cout << std::endl << "Enter Input 3: "; std::cin >> input3; If for input1 I enter something like "Good day neighbors" then input1 is set to "...

Using Tritonus AudioSystem: Convert PCM byte[] array to mp3 byte[] array

One of the libraries in my audio project continually outputs a byte[] array stream of PCM audio (along with a length and offset integer). I'm learning to use the Tritonus implementation of the Java Sound API to encode this PCM stream into mp3. The Java Sound API provides an converted/encoded byte[] array via an AudioInputStream (create...

Blackberry: Download and display .jpg image

I am trying to pull a .jpg image off of a server, and display it as and EncodedImage in a ZoomScreen. Because this .jpg could be very large I want to save the .jpg to a file and read it from there so i don't have the whole thing sitting in memory. The problem I'm facing is that Connector.open("http.url.com/file.jpg") is either throwing ...

How to make a deep copy of an InputStream in Java ?

Hi guys, I would like to know how to make a deep copy of an InputStream? I know that we can do it with IOUtils packages but I would like to avoid it if possible. Does anyone know how to make it please? Thank you ! ...

Reading Zip file in Google App Engine using java (Struts)

Hi, I am having problems reading a zip file that I have uploaded to the server (GAE). I am uploading a zip file with a csv file that I need to read in order to write to the database. However, GAE does not allow direct writing of the file on server. How do I open an inputstream to read the file? I am using struts framework. Part of my up...