@@ -0,0 +1,1028 @@
+package ucar.nc2.iosp.bufr;%0A%0Aimport org.junit.Test;%0Aimport ucar.nc2.NetcdfFile;%0Aimport ucar.nc2.dataset.NetcdfDataset;%0Aimport ucar.unidata.io.RandomAccessFile;%0A%0Aimport java.io.IOException;%0A%0A/**%0A * Created by snake on 2/28/2015.%0A */%0Apublic class TestOpenInMemory %7B%0A%0A  @Test%0A%0A  public void testOpen() throws Exception %7B%0A    scanBufrFile(%22C:/work/BUFR_99990223.bin%22);%0A  %7D%0A%0A  private boolean scanBufrFile(String filename) throws IOException, IllegalAccessException, InstantiationException, ClassNotFoundException %7B%0A    int count = 0;%0A    try (RandomAccessFile raf = new RandomAccessFile(filename, %22r%22)) %7B%0A%0A      MessageScanner scan = new MessageScanner(raf);%0A      while (scan.hasNext()) %7B%0A        Message m = scan.next();%0A        if (m == null) continue;%0A          byte%5B%5D mbytes = scan.getMessageBytes(m);%0A          try( NetcdfFile ncfile = NetcdfFile.openInMemory(%22test%22, mbytes,  %22ucar.nc2.iosp.bufr.BufrIosp2%22)) %7B%0A            NetcdfDataset ncd = new NetcdfDataset(ncfile);%0A          %7D%0A%0A        %7D%0A      %7D%0A    return true;%0A  %7D%0A%0A%7D%0A

test bufr