Android Open Source - aBusTripMK Stream Utils






From Project

Back to project page aBusTripMK.

License

The source code is released under:

GNU General Public License

If you think the Android project aBusTripMK 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

// Created by plusminus on 19:14:08 - 20.10.2008
package org.andnav.osm.services.util;
//ww  w  .  j a  va  2s .  c  o m
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;


public class StreamUtils {
        // ===========================================================
        // Constants
        // ===========================================================
        
        public static final int IO_BUFFER_SIZE = 8 * 1024;

        // ===========================================================
        // Fields
        // ===========================================================

        // ===========================================================
        // Constructors
        // ===========================================================

        // ===========================================================
        // Getter & Setter
        // ===========================================================

        // ===========================================================
        // Methods from SuperClass/Interfaces
        // ===========================================================

        // ===========================================================
        // Methods
        // ===========================================================
        
        /**
         * Copy the content of the input stream into the output stream, using a temporary
         * byte array buffer whose size is defined by {@link #IO_BUFFER_SIZE}.
         *
         * @param in The input stream to copy from.
         * @param out The output stream to copy to.
         *
         * @throws IOException If any error occurs during the copy.
         */
        public static void copy(InputStream in, OutputStream out) throws IOException {
                byte[] b = new byte[IO_BUFFER_SIZE];
                int read;
                while ((read = in.read(b)) != -1) {
                        out.write(b, 0, read);
                }
        }

        /**
         * Closes the specified stream.
         *
         * @param stream The stream to close.
         */
        public static void closeStream(Closeable stream) {
                if (stream != null) {
                        try {
                                stream.close();
                        } catch (IOException e) {
                                android.util.Log.e("IO", "Could not close stream", e);
                        }
                }
        } 

        // ===========================================================
        // Inner and Anonymous Classes
        // ===========================================================
}




Java Source Code List

com.app.busmk.DataBaseHelper.java
com.app.busmk.MyOverLay.java
com.app.busmk.a12.java
com.app.busmk.a15.java
com.app.busmk.a19.java
com.app.busmk.a22.java
com.app.busmk.a24.java
com.app.busmk.a2.java
com.app.busmk.a3.java
com.app.busmk.a41.java
com.app.busmk.a5.java
com.app.busmk.a65b.java
com.app.busmk.a7.java
com.app.busmk.a8.java
com.app.busmk.about.java
com.app.busmk.baraj_lista.java
com.app.busmk.baraj_mapa.java
com.app.busmk.main.java
com.app.busmk.main_menu.java
com.app.busmk.other.java
com.app.busmk.splash.java
org.andnav.osm.exceptions.EmptyCacheException.java
org.andnav.osm.services.OpenStreetMapTileProviderService.java
org.andnav.osm.services.util.OpenStreetMapAsyncTileProvider.java
org.andnav.osm.services.util.OpenStreetMapTileDownloader.java
org.andnav.osm.services.util.OpenStreetMapTileFilesystemProvider.java
org.andnav.osm.services.util.OpenStreetMapTileProviderDataBase.java
org.andnav.osm.services.util.OpenStreetMapTile.java
org.andnav.osm.services.util.StreamUtils.java
org.andnav.osm.services.util.constants.OpenStreetMapServiceConstants.java
org.andnav.osm.util.BoundingBoxE6.java
org.andnav.osm.util.GeoPoint.java
org.andnav.osm.util.MyMath.java
org.andnav.osm.util.NetworkLocationIgnorer.java
org.andnav.osm.util.constants.GeoConstants.java
org.andnav.osm.util.constants.OpenStreetMapConstants.java
org.andnav.osm.views.OpenStreetMapViewController.java
org.andnav.osm.views.OpenStreetMapView.java
org.andnav.osm.views.overlay.MyLocationOverlay.java
org.andnav.osm.views.overlay.OpenStreetMapTilesOverlay.java
org.andnav.osm.views.overlay.OpenStreetMapViewItemizedOverlay.java
org.andnav.osm.views.overlay.OpenStreetMapViewOverlayItem.java
org.andnav.osm.views.overlay.OpenStreetMapViewOverlay.java
org.andnav.osm.views.util.HttpUserAgentHelper.java
org.andnav.osm.views.util.LRUMapTileCache.java
org.andnav.osm.views.util.Mercator.java
org.andnav.osm.views.util.MyMath.java
org.andnav.osm.views.util.OpenStreetMapRendererInfo.java
org.andnav.osm.views.util.OpenStreetMapTileCache.java
org.andnav.osm.views.util.OpenStreetMapTileProvider.java
org.andnav.osm.views.util.constants.MathConstants.java
org.andnav.osm.views.util.constants.OpenStreetMapViewConstants.java