Package java.io

Examples of java.io.DataInputStream.readDouble()


          long date = in.readLong();
          if (date > -1)
            value = new Date(date);
          break;
        case DOUBLE:
          value = in.readDouble();
          break;
        case EMBEDDED:
          length = in.readInt();
          if (length >= 0) {
            // != NULL
View Full Code Here


    DataInputStream dataInput = new DataInputStream(input);
    int size = dataInput.readInt();

    result = new double[size];
    for (int i = 0; i < size; i++) {
      result[i] = dataInput.readDouble();
    }
    return result;
  }

  private byte[] encodeBaselines(double[] dataInDoubleArray) throws IOException {
View Full Code Here

    }

    public Double bytesToDouble(byte[] b) {
        DataInputStream dis = new DataInputStream(new ByteArrayInputStream(b));
        try {
            return new Double(dis.readDouble());
        } catch (IOException e) {
            LogUtils.warn(this, "Unable to convert bytearray to double, " +
                    "caught IOException <" + e.getMessage() + ">",
                    PigWarning.FIELD_DISCARDED_TYPE_CONVERSION_FAILED,
                    mLog);
View Full Code Here

/* 876 */     ByteArrayInputStream byteStream = new ByteArrayInputStream(buffer);
/* 877 */     DataInputStream dataIn = new DataInputStream(byteStream);
/*     */
/* 879 */     double[] array = new double[dataIn.readInt()];
/* 880 */     for (int i = 0; i < array.length; i++) {
/* 881 */       array[i] = dataIn.readDouble();
/*     */     }
/* 883 */     dataIn.close();
/*     */
/* 885 */     return array;
/*     */   }
View Full Code Here

      content[i] = (byte) readByte();
    }
    byteIn =  new ByteArrayInputStream(content);
    dataIn = new DataInputStream(byteIn);
    try {
      result = dataIn.readDouble();
      dataIn.close();
    } catch (IOException e) {
      e.printStackTrace();
    }
   
View Full Code Here

           
            System.err.println("before while()");
            while (true) {
                try {
                    System.err.println("before readObject");
                    double lat=dis.readDouble();
                    double lon=dis.readDouble();
                    MapPoint mp=new MapPoint(lon,lat);
                    System.err.println("mp is="+mp.toString());
                    add(mp);
                } catch (IOException e) {
View Full Code Here

            System.err.println("before while()");
            while (true) {
                try {
                    System.err.println("before readObject");
                    double lat=dis.readDouble();
                    double lon=dis.readDouble();
                    MapPoint mp=new MapPoint(lon,lat);
                    System.err.println("mp is="+mp.toString());
                    add(mp);
                } catch (IOException e) {
                    break;
View Full Code Here

    DataPoint dataPoints[] = new DataPoint[dpCount];

    for (int i = 0; i < dataPoints.length; i++) {
      try {
        double mz = peakStream.readDouble();
        double intensity = peakStream.readDouble();
        dataPoints[i] = new SimpleDataPoint(mz, intensity);
      } catch (IOException e) {
        e.printStackTrace();
      }
View Full Code Here

    DataPoint dataPoints[] = new DataPoint[dpCount];

    for (int i = 0; i < dataPoints.length; i++) {
      try {
        double mz = peakStream.readDouble();
        double intensity = peakStream.readDouble();
        dataPoints[i] = new SimpleDataPoint(mz, intensity);
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
View Full Code Here

            // Always respect this order pairOrder="m/z-int"
            double massOverCharge;
            double intensity;
            if ("64".equals(precision)) {
              massOverCharge = peakStream.readDouble();
              intensity = peakStream.readDouble();
            } else {
              massOverCharge = (double) peakStream.readFloat();
              intensity = (double) peakStream.readFloat();
            }
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.