Package java.io

Examples of java.io.DataOutputStream.writeFloat()


        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        outputStream = new DataOutputStream(baos);
        try {
            outputStream.writeUTF(location);
            outputStream.writeFloat(latitude);
            outputStream.writeFloat(longitude);
            outputStream.writeByte(timeZoneSrc);
            outputStream.writeShort(timeZoneMin;
            outputStream.writeBoolean(isDSTOn);
            outputStream.writeShort(altitude);
            outputStream.writeShort(temperature);
View Full Code Here


        dos.writeLong(l);
        break;

      case FLOAT:
        float f = ((FloatObjectInspector) oi).get(o);
        dos.writeFloat(f);
        break;

      case DOUBLE:
        double d = ((DoubleObjectInspector) oi).get(o);
        dos.writeDouble(d);
View Full Code Here

      os.writeInt(MAGIC);
      os.writeInt(VERSION);
      os.writeInt(sampleRate);
      os.writeInt(numChannels);
      os.writeFloat(lpcMin);
      os.writeFloat(lpcRange);
      os.writeInt(diphoneMap.size());

      for (Iterator i = diphoneMap.values().iterator(); i.hasNext();) {
    Diphone diphone = (Diphone) i.next();
View Full Code Here

      os.writeInt(MAGIC);
      os.writeInt(VERSION);
      os.writeInt(sampleRate);
      os.writeInt(numChannels);
      os.writeFloat(lpcMin);
      os.writeFloat(lpcRange);
      os.writeInt(diphoneMap.size());

      for (Iterator i = diphoneMap.values().iterator(); i.hasNext();) {
    Diphone diphone = (Diphone) i.next();
    diphone.dumpBinary(os);
View Full Code Here

      DataOutputStream output = new DataOutputStream(dout);
      try {
        if (value instanceof Double) {
          output.writeDouble(value.doubleValue());
        } else if (value instanceof Float) {
          output.writeFloat(value.floatValue());
        } else if (value instanceof Integer) {
          output.writeInt(value.intValue());
        } else if (value instanceof Short) {
          output.writeShort(value.shortValue());
        } else if (value instanceof Long) {
View Full Code Here

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

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

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

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

 
  public static void writeFloatByRow(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.writeFloat((float)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.