Android Open Source - bt-android-utils String Helper






From Project

Back to project page bt-android-utils.

License

The source code is released under:

Copyright (c) 2011 Brian J. Tarricone <brian@tarricone.org> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the follo...

If you think the Android project bt-android-utils 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 org.spurint.android.helpers;
/* w w w . j  a  v  a2  s . c  om*/
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;

public abstract class StringHelper {
    public static String stringFromInputStream(InputStream is) {
        final char[] buffer = new char[1024];
        StringBuilder out = new StringBuilder();

        try {
            Reader in = new InputStreamReader(is, "UTF-8");
            int bin;
            do {
                bin = in.read(buffer);
                if (bin > 0) {
                    out.append(buffer, 0, bin);
                }
            } while (bin >= 0);
        } catch (Exception e) {
            return null;
        }

        return out.toString();
    }
}




Java Source Code List

org.spurint.android.helpers.StringHelper.java
org.spurint.android.listview.ListRowAdapter.java
org.spurint.android.listview.ListRow.java
org.spurint.android.listview.SectionHeaderRow.java
org.spurint.android.net.Network.java
org.spurint.android.viewcontroller.ListViewController.java
org.spurint.android.viewcontroller.NavigationController.java
org.spurint.android.viewcontroller.ViewControllerActivity.java
org.spurint.android.viewcontroller.ViewController.java