log.debug("Saved "); log.debug(sf.toString());
   public final void saveScreen()        throws IOException  {      ByteArrayOutputStream sc = new ByteArrayOutputStream();      sc.write(4);      sc.write(0x12);  // 18      sc.write(0);  // 18      sc.write(0);  // 18      sc.write((byte)screen52.getRows());   // store the current size      sc.write((byte)screen52.getCols());   //    ""      int cp = screen52.getCurrentPos(); // save off current position      sc.write((byte)(cp >> 8 & 0xff));          //    ""      sc.write((byte)(cp & 0xff));               //    ""      sc.write((byte)(screen52.homePos >> 8 & 0xff));       // save home pos      sc.write((byte)(screen52.homePos & 0xff));            //    ""      int rows = screen52.getRows();   // store the current size      int cols = screen52.getCols();   //    ""      byte[] sa = new byte[rows * cols];      fillScreenArray(sa, rows, cols);      sc.write(sa);      sa = null;      int sizeFields = screen52.getScreenFields().getSize();      sc.write((byte)(sizeFields >> 8 & 0xff));          //    ""      sc.write((byte)(sizeFields & 0xff));               //    ""      if (sizeFields > 0) {         int x = 0;         int s = screen52.getScreenFields().getSize();         ScreenField sf = null;         while (x < s) {            sf = screen52.getScreenFields().getField(x);            sc.write((byte)sf.getAttr());          // attribute            int sp = sf.startPos();            sc.write((byte)(sp >> 8 & 0xff));          //    ""            sc.write((byte)(sp & 0xff));               //    ""            if (sf.mdt)               sc.write((byte)1);            else               sc.write((byte)0);            sc.write((byte)(sf.getLength() >> 8 & 0xff));          //    ""            sc.write((byte)(sf.getLength() & 0xff));               //    ""            sc.write((byte)sf.getFFW1() & 0xff);            sc.write((byte)sf.getFFW2() & 0xff);            sc.write((byte)sf.getFCW1() & 0xff);            sc.write((byte)sf.getFCW2() & 0xff);//            System.out.println("Saved ");//            System.out.println(sf.toString());            x++;         }         sf = null;      }      // The following two lines of code looks to have caused all sorts of      //    problems so for now we have commented them out.//      screen52.getScreenFields().setCurrentField(null);    // set it to null for GC ?//      screen52.clearTable();      try {         writeGDS(0, 3, sc.toByteArray());      }      catch (IOException ioe) {        System.out.println(ioe.getMessage());      }      sc = null;//      System.out.println("Save Screen end ");   }