Code example for ObjectInputStream

Methods: readObject

0
        byte[] sampleB = cursor.getBlob(cursor
                .getColumnIndex(CaratSampleDB.COLUMN_SAMPLE));
        if (sampleB != null) {
            ObjectInputStream oi;
            try { 
                oi = new ObjectInputStream(new ByteArrayInputStream(sampleB));
                Object o = oi.readObject();
                if (o != null)
                    s = (Sample) o;
            } catch (StreamCorruptedException e) {
                // TODO Auto-generated catch block 
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block 
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                // TODO Auto-generated catch block 
                e.printStackTrace();
            } 
        }