Code example for DataInputStream

Methods: decodeStreamreadUTFclose

0
        BufferedInputStream b = null;
        DataInputStream d = null;
        try { 
            f = new FileInputStream(filePath);
            b = new BufferedInputStream(f, BUFSIZE);
            d = new DataInputStream(b);
            Uri uri = Uri.parse(d.readUTF());
            Bitmap thumb = BitmapFactory.decodeStream(d);
            setData(uri, thumb);
            d.close();
        } catch (IOException e) {
            return false; 
        } finally { 
            MenuHelper.closeSilently(f);
            MenuHelper.closeSilently(b);
            MenuHelper.closeSilently(d);
        } 
        return true; 
    } 
 
    public void updateDisplayIfNeeded() { 
Stop searching for code, let great code find you!  Add Codota to your java IDE