Esempio n. 1
0
        /**
         * Writes a fault skin to a file with specified name.
         * @param fileName the fault skin file name.
         * @param skin the fault skin.
         */
        public static void writeToFile(String fileName, FaultSkin skin)
        {
            throw new NotImplementedException();
#if false
            try {
                ArrayOutputStream aos = new ArrayOutputStream(fileName);
                aos.writeInt(skin.size());
                aos.writeInt(skin._seed.i1);
                aos.writeInt(skin._seed.i2);
                aos.writeInt(skin._seed.i3);
                for (FaultCell cell:skin)
                {
                    aos.writeFloat(cell.x1);
                    aos.writeFloat(cell.x2);
                    aos.writeFloat(cell.x3);
                    aos.writeFloat(cell.fl);
                    aos.writeFloat(cell.fp);
                    aos.writeFloat(cell.ft);
                    aos.writeFloat(cell.s1);
                    aos.writeFloat(cell.s2);
                    aos.writeFloat(cell.s3);
                }
                for (FaultCell cell:skin)
                {
                    FaultCell[] nabors = new FaultCell[] { cell.ca, cell.cb, cell.cl, cell.cr };
                    for (FaultCell nabor:nabors)
                    {
                        if (nabor != null)
                        {
                            aos.writeInt(nabor.i1);
                            aos.writeInt(nabor.i2);
                            aos.writeInt(nabor.i3);
                        }
                        else
                        {
                            aos.writeInt(INULL);
                            aos.writeInt(INULL);
                            aos.writeInt(INULL);
                        }
                    }
                }
                aos.close();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
#endif
        }