Android Open Source - NetworkClipboardAndroid Input Stream Utils






From Project

Back to project page NetworkClipboardAndroid.

License

The source code is released under:

GNU General Public License

If you think the Android project NetworkClipboardAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.adyrsoft.framework.android;
/*w w w.  ja va 2s. c  o  m*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.apache.http.util.ByteArrayBuffer;

public final class InputStreamUtils {
  private InputStreamUtils() {};
  
  public static String toString(InputStream is) throws IOException {
      int char_ = 0;
      ByteArrayBuffer total = new ByteArrayBuffer(0);
      
      // Wrap a BufferedReader around the InputStream
      BufferedReader rd = new BufferedReader(new InputStreamReader(is));
      

      // Read response until the end
      while ((char_ = rd.read()) != -1) { 
          total.append(char_); 
      }
      
      
      // Return full string
      String output = new String(total.toByteArray());
      return output;
  }
}




Java Source Code List

com.adyrhan.networkclipboard.BootReceiver.java
com.adyrhan.networkclipboard.HttpServer.java
com.adyrhan.networkclipboard.NetworkClipboardService.java
com.adyrhan.networkclipboard.PortIOError.java
com.adyrhan.networkclipboard.ServiceControlActivity.java
com.adyrsoft.framework.android.InputStreamUtils.java