Package java.io

Examples of java.io.DataOutputStream.writeDouble()


        DataOutputStream outStream = new DataOutputStream(out);
        int pointsCount = function.getPointsCount();
        outStream.writeInt(pointsCount);
        for (int i = 0; i < pointsCount; i++) {
            outStream.writeDouble(function.getPointX(i));
            outStream.writeDouble(function.getPointY(i));
        }
        outStream.close();
    }

    public static TabulatedFunction inputTabulatedFunction(InputStream in) throws IOException {
View Full Code Here


        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        DataOutputStream s = new DataOutputStream(bos);
        try
        {
            s.writeLong(d.size);
            s.writeDouble(d.compressionFactor);
            s.writeLong(d.capacity);
            s.writeInt(d.node2count.size());
            for (long k : d.node2count.keySet())
            {
                s.writeLong(k);
View Full Code Here

public class BinaryWriter {
  //--------- One Dimensional Array -----------------------
  public static void writeDouble(double[] data,String outputFile) throws IOException{
    DataOutputStream out = new DataOutputStream(new FileOutputStream(outputFile));
    for(int i=0; i<data.length; ++i){
      out.writeDouble(data[i]);
    }
    out.close();
  }
 
  public static void writeDouble(float[] data,String outputFile) throws IOException{
View Full Code Here

  }
 
  public static void writeDouble(float[] data,String outputFile) throws IOException{
    DataOutputStream out = new DataOutputStream(new FileOutputStream(outputFile));
    for(int i=0; i<data.length; ++i){
      out.writeDouble(data[i]);
    }
    out.close();
  }
 
  public static void writeDouble(int[] data,String outputFile) throws IOException{
View Full Code Here

  }
 
  public static void writeDouble(int[] data,String outputFile) throws IOException{
    DataOutputStream out = new DataOutputStream(new FileOutputStream(outputFile));
    for(int i=0; i<data.length; ++i){
      out.writeDouble(data[i]);
    }
    out.close();
  }
 
  public static void writeDouble(boolean[] data,String outputFile) throws IOException{
View Full Code Here

  }
 
  public static void writeDouble(boolean[] data,String outputFile) throws IOException{
    DataOutputStream out = new DataOutputStream(new FileOutputStream(outputFile));
    for(int i=0; i<data.length; ++i){
      out.writeDouble(data[i]?1:0);
    }
    out.close();
  }
 
  public static void writeFloat(double[] data,String outputFile) throws IOException{
View Full Code Here

 
  public static void writeDoubleByRow(double[][] data,String outputFile) throws IOException{
    DataOutputStream out = new DataOutputStream(new FileOutputStream(outputFile));
    for(int rowIndex=0; rowIndex<data.length; ++rowIndex){
      for(int columnIndex=0; columnIndex<data[rowIndex].length; ++columnIndex){
        out.writeDouble(data[rowIndex][columnIndex]);
      }
    }
    out.close();
  }
 
View Full Code Here

 
  public static void writeDoubleByColumn(double[][] data,String outputFile) throws IOException{
    DataOutputStream out = new DataOutputStream(new FileOutputStream(outputFile));
    for(int columnIndex=0; columnIndex<data[0].length; ++columnIndex){
      for(int rowIndex=0; rowIndex<data.length; ++rowIndex){
        out.writeDouble(data[rowIndex][columnIndex]);
      }
    }
    out.close();
  }
 
View Full Code Here

 
  public static void writeDoubleByRow(float[][] data,String outputFile) throws IOException{
    DataOutputStream out = new DataOutputStream(new FileOutputStream(outputFile));
    for(int rowIndex=0; rowIndex<data.length; ++rowIndex){
      for(int columnIndex=0; columnIndex<data[rowIndex].length; ++columnIndex){
        out.writeDouble(data[rowIndex][columnIndex]);
      }
    }
    out.close();
  }
 
View Full Code Here

 
  public static void writeDoubleByColumn(float[][] data,String outputFile) throws IOException{
    DataOutputStream out = new DataOutputStream(new FileOutputStream(outputFile));
    for(int columnIndex=0; columnIndex<data[0].length; ++columnIndex){
      for(int rowIndex=0; rowIndex<data.length; ++rowIndex){
        out.writeDouble(data[rowIndex][columnIndex]);
      }
    }
    out.close();
  }
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.