Code example for GZIPInputStream

0
        return null; 
    } 
 
    public void copyDbToDevice(int res, String db_name) throws NullPointerException, IOException {
        // InputStream in = ctxt.getResources().openRawResource(res); 
        GZIPInputStream in = new GZIPInputStream(ctxt.getResources().openRawResource(res));
        OutputStream out = ctxt.openFileOutput(db_name, Context.MODE_PRIVATE);
        final ReadableByteChannel ic = Channels.newChannel(in);
        final WritableByteChannel oc = Channels.newChannel(out);
        DownloadFile.fastChannelCopy(ic, oc);
    } 
}