public void setBufrFile(RandomAccessFile raf) throws IOException { this.raf = raf; java.util.List<MessageBean> beanList = new ArrayList<MessageBean>(); scan = new MessageScanner(raf); while (scan.hasNext()) { Message m = scan.next(); if (m == null) continue; beanList.add(new MessageBean(m)); } messageTable.setBeans(beanList); obsTable.setBeans(new ArrayList()); ddsTable.setBeans(new ArrayList()); }
private NetcdfDataset getBufrMessageAsDataset(Message m) throws IOException { byte[] mbytes = scan.getMessageBytes(m); NetcdfFile ncfile = null; try { ncfile = NetcdfFile.openInMemory("test", mbytes, "ucar.nc2.iosp.bufr.BufrIosp"); } catch (Exception e) { throw new IOException(e); } return new NetcdfDataset(ncfile); }