ArrayReaderWriter
jhplot.io

Class ArrayReaderWriter



  • public class ArrayReaderWriterextends Object
    Class for reading binary data from files to multidimensional arrays and writing binary data to files from multidimensional arrays.
     Copyright (C) 2005  Vincent Cheung (vincent@psi.toronto.edu, http://www.psi.toronto.edu/~vincent/)  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
    • Method Summary

      Methods 
      Modifier and TypeMethod and Description
      static BufferedOutputStreamgetStream(String filename)
      Create a stream to the file specified by filename.
      static voidmain(String[] args) 
      static double[]read1DArray(String filename)
      Reads an array from a file.
      static boolean[]read1DBooleanArray(String filename)
      Reads an array from a file.
      static float[]read1DFloatArray(String filename)
      Reads an array from a file.
      static int[]read1DIntArray(String filename)
      Reads an array from a file.
      static double[][]read2DArray(String filename)
      Reads a rectangular jagged array from a file.
      static boolean[][]read2DBooleanArray(String filename)
      Reads a rectangular jagged array from a file.
      static float[][]read2DFloatArray(String filename)
      Reads a rectangular jagged array from a file.
      static int[][]read2DIntArray(String filename)
      Reads a rectangular jagged array from a file.
      static double[][][]read3DArray(String filename)
      Reads a rectangular jagged array from a file.
      static boolean[][][]read3DBooleanArray(String filename)
      Reads a rectangular jagged array from a file.
      static float[][][]read3DFloatArray(String filename)
      Reads a rectangular jagged array from a file.
      static int[][][]read3DIntArray(String filename)
      Reads a rectangular jagged array from a file.
      static double[][][][]read4DArray(String filename)
      Reads a rectangular jagged array from a file.
      static boolean[][][][]read4DBooleanArray(String filename)
      Reads a rectangular jagged array from a file.
      static float[][][][]read4DFloatArray(String filename)
      Reads a rectangular jagged array from a file.
      static int[][][][]read4DIntArray(String filename)
      Reads a rectangular jagged array from a file.
      static double[][][][][]read5DArray(String filename)
      Reads a rectangular jagged array from a file.
      static boolean[][][][][]read5DBooleanArray(String filename)
      Reads a rectangular jagged array from a file.
      static float[][][][][]read5DFloatArray(String filename)
      Reads a rectangular jagged array from a file.
      static int[][][][][]read5DIntArray(String filename)
      Reads a rectangular jagged array from a file.
      static voidwrite(boolean[][][][][] array, String filename)
      Writes a rectangular jagged array to a file.
      static voidwrite(boolean[][][][] array, String filename)
      Writes a rectangular jagged array to a file.
      static voidwrite(boolean[][][] array, String filename)
      Writes a rectangular jagged array to a file.
      static voidwrite(boolean[][] array, String filename)
      Writes a rectangular jagged array to a file.
      static voidwrite(boolean[] array, String filename)
      Writes an array to a file.
      static voidwrite(double[][][][][] array, String filename)
      Writes a rectangular jagged array to a file.
      static voidwrite(double[][][][] array, String filename)
      Writes a rectangular jagged array to a file.
      static voidwrite(double[][][] array, String filename)
      Writes a rectangular jagged array to a file.
      static voidwrite(double[][] array, String filename)
      Writes a rectangular jagged array to a file.
      static voidwrite(double[] array, String filename)
      Writes an array to a file.
      static voidwrite(float[][][][][] array, String filename)
      Writes a rectangular jagged array to a file.
      static voidwrite(float[][][][] array, String filename)
      Writes a rectangular jagged array to a file.
      static voidwrite(float[][][] array, String filename)
      Writes a rectangular jagged array to a file.
      static voidwrite(float[][] array, String filename)
      Writes a rectangular jagged array to a file.
      static voidwrite(float[] array, String filename)
      Writes an array to a file.
      static voidwrite(int[][][][][] array, String filename)
      Writes a rectangular jagged array to a file.
      static voidwrite(int[][][][] array, String filename)
      Writes a rectangular jagged array to a file.
      static voidwrite(int[][][] array, String filename)
      Writes a rectangular jagged array to a file.
      static voidwrite(int[][] array, String filename)
      Writes a rectangular jagged array to a file.
      static voidwrite(int[] array, String filename)
      Writes an array to a file.
    • Constructor Detail

      • ArrayReaderWriter

        public ArrayReaderWriter()
    • Method Detail

      • write

        public static void write(double[] array,         String filename)                  throws IOException
        Writes an array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • write

        public static void write(double[][] array,         String filename)                  throws IOException
        Writes a rectangular jagged array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • write

        public static void write(double[][][] array,         String filename)                  throws IOException
        Writes a rectangular jagged array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • write

        public static void write(double[][][][] array,         String filename)                  throws IOException
        Writes a rectangular jagged array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • write

        public static void write(double[][][][][] array,         String filename)                  throws IOException
        Writes a rectangular jagged array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • read1DArray

        public static double[] read1DArray(String filename)                            throws IOException
        Reads an array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • read2DArray

        public static double[][] read2DArray(String filename)                              throws IOException
        Reads a rectangular jagged array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • read3DArray

        public static double[][][] read3DArray(String filename)                                throws IOException
        Reads a rectangular jagged array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • read4DArray

        public static double[][][][] read4DArray(String filename)                                  throws IOException
        Reads a rectangular jagged array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • read5DArray

        public static double[][][][][] read5DArray(String filename)                                    throws IOException
        Reads a rectangular jagged array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • write

        public static void write(float[] array,         String filename)                  throws IOException
        Writes an array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • write

        public static void write(float[][] array,         String filename)                  throws IOException
        Writes a rectangular jagged array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • write

        public static void write(float[][][] array,         String filename)                  throws IOException
        Writes a rectangular jagged array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • write

        public static void write(float[][][][] array,         String filename)                  throws IOException
        Writes a rectangular jagged array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • write

        public static void write(float[][][][][] array,         String filename)                  throws IOException
        Writes a rectangular jagged array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • read1DFloatArray

        public static float[] read1DFloatArray(String filename)                                throws IOException
        Reads an array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • read2DFloatArray

        public static float[][] read2DFloatArray(String filename)                                  throws IOException
        Reads a rectangular jagged array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • read3DFloatArray

        public static float[][][] read3DFloatArray(String filename)                                    throws IOException
        Reads a rectangular jagged array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • read4DFloatArray

        public static float[][][][] read4DFloatArray(String filename)                                      throws IOException
        Reads a rectangular jagged array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • read5DFloatArray

        public static float[][][][][] read5DFloatArray(String filename)                                        throws IOException
        Reads a rectangular jagged array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • write

        public static void write(int[] array,         String filename)                  throws IOException
        Writes an array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. Integers are converted to doubles. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • write

        public static void write(int[][] array,         String filename)                  throws IOException
        Writes a rectangular jagged array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. Integers are converted to doubles. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • write

        public static void write(int[][][] array,         String filename)                  throws IOException
        Writes a rectangular jagged array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. Integers are converted to doubles. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • write

        public static void write(int[][][][] array,         String filename)                  throws IOException
        Writes a rectangular jagged array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. Integers are converted to doubles. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • write

        public static void write(int[][][][][] array,         String filename)                  throws IOException
        Writes a rectangular jagged array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. Integers are converted to doubles. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • read1DIntArray

        public static int[] read1DIntArray(String filename)                            throws IOException
        Reads an array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. Double values in the file are converted to integers. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • read2DIntArray

        public static int[][] read2DIntArray(String filename)                              throws IOException
        Reads a rectangular jagged array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. Double values in the file are converted to integers. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • read3DIntArray

        public static int[][][] read3DIntArray(String filename)                                throws IOException
        Reads a rectangular jagged array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. Double values in the file are converted to integers. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • read4DIntArray

        public static int[][][][] read4DIntArray(String filename)                                  throws IOException
        Reads a rectangular jagged array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. Double values in the file are converted to integers. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • read5DIntArray

        public static int[][][][][] read5DIntArray(String filename)                                    throws IOException
        Reads a rectangular jagged array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. Double values in the file are converted to integers. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • write

        public static void write(boolean[] array,         String filename)                  throws IOException
        Writes an array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. Boolean "true" values are converted to 1.0 and "false" to 0.0. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • write

        public static void write(boolean[][] array,         String filename)                  throws IOException
        Writes a rectangular jagged array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. Boolean "true" values are converted to 1.0 and "false" to 0.0. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • write

        public static void write(boolean[][][] array,         String filename)                  throws IOException
        Writes a rectangular jagged array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. Boolean "true" values are converted to 1.0 and "false" to 0.0. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • write

        public static void write(boolean[][][][] array,         String filename)                  throws IOException
        Writes a rectangular jagged array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. Boolean "true" values are converted to 1.0 and "false" to 0.0. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • write

        public static void write(boolean[][][][][] array,         String filename)                  throws IOException
        Writes a rectangular jagged array to a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. Boolean "true" values are converted to 1.0 and "false" to 0.0. All values are written to the file in little endian form. If the file already exists, then it will be overwritten.
        Parameters:
        array - the array to write to the file
        filename - the name of the file to write to
        Throws:
        IOException
      • read1DBooleanArray

        public static boolean[] read1DBooleanArray(String filename)                                    throws IOException
        Reads an array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • read2DBooleanArray

        public static boolean[][] read2DBooleanArray(String filename)                                      throws IOException
        Reads a rectangular jagged array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • read3DBooleanArray

        public static boolean[][][] read3DBooleanArray(String filename)                                        throws IOException
        Reads a rectangular jagged array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • read4DBooleanArray

        public static boolean[][][][] read4DBooleanArray(String filename)                                          throws IOException
        Reads a rectangular jagged array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. 1.0 values are converted to "true" and 0.0 to "false". All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • read5DBooleanArray

        public static boolean[][][][][] read5DBooleanArray(String filename)                                            throws IOException
        Reads a rectangular jagged array from a file. The first four bytes (an integer) in the file indicate the number of dimensions of the array. The size of the array along each of the dimensions are then written as four bytes each (integers), note that the size along each of the dimensions must remain constant The rest of the file contains the array values (double values) The 64-bit IEEE 754 floating-point "double format" bit layout is used to write the byte representation of double values to the file. 1.0 values are converted to "true" and 0.0 to "false". All values are written to the file in little endian form.
        Parameters:
        filename - the name of the file containing the array
        Returns:
        the array in the file
        Throws:
        IOException
      • getStream

        public static BufferedOutputStream getStream(String filename)                                      throws IOException
        Create a stream to the file specified by filename. If the file already exists, it is overwritten. The necessary directories are created.
        Parameters:
        filename - the name of the file.
        Returns:
        a stream to the file.
        Throws:
        IOException
      • main

        public static void main(String[] args)

SCaVis 1.7 © jWork.org