Package java.io

Examples of java.io.DataInputStream.readFloat()


            double intensity;
            if ("64".equals(precision)) {
              massOverCharge = peakStream.readDouble();
              intensity = peakStream.readDouble();
            } else {
              massOverCharge = (double) peakStream.readFloat();
              intensity = (double) peakStream.readFloat();
            }

            // Copy m/z and intensity data
            completeDataPoints[i] = new SimpleDataPoint(
View Full Code Here


            if ("64".equals(precision)) {
              massOverCharge = peakStream.readDouble();
              intensity = peakStream.readDouble();
            } else {
              massOverCharge = (double) peakStream.readFloat();
              intensity = (double) peakStream.readFloat();
            }

            // Copy m/z and intensity data
            completeDataPoints[i] = new SimpleDataPoint(
                massOverCharge, intensity);
View Full Code Here

      DataInputStream dataInputStream = new DataInputStream(
          new ByteArrayInputStream(bytes));
      masses = new double[numOfMZpeaks];
      for (int i = 0; i < numOfMZpeaks; i++) {
        try {
          masses[i] = (double) dataInputStream.readFloat();
        } catch (IOException ex) {
          throw new SAXException(ex);
        }
      }
    }
View Full Code Here

      DataInputStream dataInputStream = new DataInputStream(
          new ByteArrayInputStream(bytes));
      intensities = new double[numOfMZpeaks];
      for (int i = 0; i < numOfMZpeaks; i++) {
        try {
          intensities[i] = (double) dataInputStream.readFloat();
        } catch (IOException ex) {
          throw new SAXException(ex);
        }
      }
    }
View Full Code Here

                    Array.setLong(data, index, dis.readLong());
                    delegate.size++;
                }
            } else if (type == Float.TYPE) {
                for (int i = 0; i < count; i++, index++) {
                    Array.setFloat(data, index, dis.readFloat());
                    delegate.size++;
                }
            } else if (type == Double.TYPE) {
                for (int i = 0; i < count; i++, index++) {
                    Array.setDouble(data, index, dis.readDouble());
View Full Code Here

            for (; i < len && i < m + b.length / fmtsiz; i++)
              data[i + offset] = (int) ds.readDouble();
            break;
          case TFormat.CF_FLOAT:
            for (; i < len && i < m + b.length / fmtsiz; i++)
              data[i + offset] = (int) ds.readFloat();
            break;
          case TFormat.CF_BITFIELD32:
          case TFormat.CF_BOOLEAN:
          case TFormat.CF_LONG:
            for (; i < len && i < m + b.length / fmtsiz; i++)
View Full Code Here

            for (; i < len && i < m + b.length / fmtsiz; i++)
              data[i + offset] = (float) ds.readDouble();
            break;
          case TFormat.CF_FLOAT:
            for (; i < len && i < m + b.length / fmtsiz; i++)
              data[i + offset] = ds.readFloat();
            break;
          case TFormat.CF_BOOLEAN:
          case TFormat.CF_LONG:
            for (; i < len && i < m + b.length / fmtsiz; i++)
              data[i + offset] = ds.readInt();
View Full Code Here

            for (; i < len && i < m + b.length / fmtsiz; i++)
              data[i + offset] = ds.readDouble();
            break;
          case TFormat.CF_FLOAT:
            for (; i < len && i < m + b.length / fmtsiz; i++)
              data[i + offset] = ds.readFloat();
            break;
          case TFormat.CF_DLONG:
            for (; i < len && i < m + b.length / fmtsiz; i++)
              data[i + offset] = ds.readLong();
            break;
View Full Code Here

            for (; i < len && i < m + b.length / fmtsiz; i++)
              data[i + offset] = (long) ds.readDouble();
            break;
          case TFormat.CF_FLOAT:
            for (; i < len && i < m + b.length / fmtsiz; i++)
              data[i + offset] = (long) ds.readFloat();
            break;
          case TFormat.CF_BITFIELD64:
          case TFormat.CF_INT64:
            for (; i < len && i < m + b.length / fmtsiz; i++)
              data[i + offset] = ds.readLong();
View Full Code Here

      for (int i = 0; i < words; i++) {
        double len = 0;
        key = dis.readUTF();
        value = new float[size];
        for (int j = 0; j < size; j++) {
          vector = dis.readFloat();
          len += vector * vector;
          value[j] = vector;
        }

        len = Math.sqrt(len);
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.