Package java.io

Examples of java.io.DataOutputStream.writeFloat()


   * @param version the version of the applet as a float
   * @throws Exception if it fails to write file
   */
  protected void writeVersionFile(File file, float version) throws Exception {
    DataOutputStream dos = new DataOutputStream(new FileOutputStream(file));
    dos.writeFloat(version);
    dos.close();
  }

  /**
   * read the current cache file
View Full Code Here


      while (iterA.hasNext())
        outStream.writeDouble(iterA.getDoubleNext());

    } else if (classType == float.class) {
      while (iterA.hasNext())
        outStream.writeFloat(iterA.getFloatNext());

    } else if (classType == long.class) {
      while (iterA.hasNext())
        outStream.writeLong(iterA.getLongNext());
View Full Code Here

      while (iterA.hasNext())
        outStream.writeDouble(iterA.getDoubleNext());

    } else if (classType == float.class) {
      while (iterA.hasNext())
        outStream.writeFloat(iterA.getFloatNext());

    } else if (classType == long.class) {
      while (iterA.hasNext())
        outStream.writeLong(iterA.getLongNext());
View Full Code Here

        DataOutputStream o = new DataOutputStream(bo);
        o.writeByte((byte)2);
        o.writeShort((short)2);
        o.writeInt(2);
        o.writeLong(2L);
        o.writeFloat(1.1f);
        o.writeDouble(1.1);
        byte[] src = bo.toByteArray();

        LinkedBufferInput b = new LinkedBufferInput(1024);
View Full Code Here

        DataOutputStream o = new DataOutputStream(bo);
        o.writeByte((byte)2);
        o.writeShort((short)2);
        o.writeInt(2);
        o.writeLong(2L);
        o.writeFloat(1.1f);
        o.writeDouble(1.1);
        byte[] src = bo.toByteArray();

        LinkedBufferInput b = new LinkedBufferInput(1024);
View Full Code Here

        o2.writeShort((short)2);
        o1.writeInt(2);
        o2.writeInt(2);
        o1.writeLong(2L);
        o2.writeLong(2L);
        o1.writeFloat(1.1f);
        o2.writeFloat(1.1f);
        o1.writeDouble(1.1);
        o2.writeDouble(1.1);
        byte[] b1 = bo.toByteArray();
        byte[] b2 = o2.toByteArray();
View Full Code Here

        o2.writeByteAndInt((byte)9, 2);
        o1.writeByte((byte)9);
        o1.writeLong(2L);
        o2.writeByteAndLong((byte)9, 2L);
        o1.writeByte((byte)9);
        o1.writeFloat(1.1f);
        o2.writeByteAndFloat((byte)9, 1.1f);
        o1.writeByte((byte)9);
        o1.writeDouble(1.1);
        o2.writeByteAndDouble((byte)9, 1.1);
        byte[] b1 = bo.toByteArray();
View Full Code Here

                // Transform all non zero values for the new matrix.
                for (int index = 0; index < nzInCurCol; ++index) {
                    int row = dis.readInt();
                    double value = dis.readFloat();
                    dos.writeInt(row);
                    dos.writeFloat(
                            (float) transform.transform(row, col, value));
                }
            }
            dos.close();
            return outFile;
View Full Code Here

                    dos.writeInt(colCount);           
                }
           
                for (int i = 0; i < nonZeroRows.length; ++i) {
                    dos.writeInt(nonZeroRows[i]);
                    dos.writeFloat(values[i]);
                }
            }
        }
        dos.close();
    }
View Full Code Here

                new BufferedOutputStream(new FileOutputStream(output)));
            outStream.writeInt(matrix.rows());
            outStream.writeInt(matrix.columns());
            for (int i = 0; i < matrix.rows(); ++i) {
                for (int j = 0; j < matrix.columns(); ++j) {
                    outStream.writeFloat((float)matrix.get(i,j));
                }
            }
            outStream.close();
            break;
        }
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.