Opens RMS record from named store and returns it as DataInputStream
(String name, int index)
| 41 | * and returns it as DataInputStream |
| 42 | */ |
| 43 | static public DataInputStream ReadFileRecord(String name, int index){ |
| 44 | DataInputStream istream=null; |
| 45 | |
| 46 | RecordStore recordStore=null; |
| 47 | try { |
| 48 | |
| 49 | recordStore = RecordStore.openRecordStore(name, false); |
| 50 | byte[] b=recordStore.getRecord(index+1); |
| 51 | |
| 52 | if (b.length!=0) |
| 53 | istream=new DataInputStream( new ByteArrayInputStream(b) ); |
| 54 | |
| 55 | } catch (Exception e) { } |
| 56 | finally { |
| 57 | try { recordStore.closeRecordStore(); } catch (Exception e) {} } |
| 58 | |
| 59 | return istream; |
| 60 | } |
| 61 | |
| 62 | |
| 63 | private static ByteArrayOutputStream baos; |
no test coverage detected