Package java.io

Examples of java.io.DataOutputStream.writeDouble()


          out.writeLong(value != null ? ((Date) value).getTime() : -1);
          break;
        case DOUBLE:
          out.writeBoolean(value != null);
          if (value != null)
            out.writeDouble((Double) value);
          break;
        case EMBEDDED:
          if (value == null)
            // NULL: WRITE -1 AS LENGTH
            out.writeInt(-1);
View Full Code Here


    ByteArrayOutputStream out = new ByteArrayOutputStream(8192);
    DataOutputStream output = new DataOutputStream(out);

    output.writeInt(dataInDoubleArray.length);
    for (double dataItem : dataInDoubleArray) {
      output.writeDouble(dataItem);
    }
    return out.toByteArray();
  }

  @Override
View Full Code Here

        dos.writeFloat(f);
        break;

      case DOUBLE:
        double d = ((DoubleObjectInspector) oi).get(o);
        dos.writeDouble(d);
        break;

      default:
        throw new RuntimeException("Hive internal error.");
      }
View Full Code Here

        dos.writeFloat(f);
        break;

      case DOUBLE:
        double d = ((DoubleObjectInspector) oi).get(o);
        dos.writeDouble(d);
        break;

      default:
        throw new RuntimeException("Hive internal error.");
      }
View Full Code Here

/* 861 */     ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
/* 862 */     DataOutputStream dataOut = new DataOutputStream(byteStream);
/*     */
/* 864 */     dataOut.writeInt(array.length);
/* 865 */     for (int i = 0; i < array.length; i++)
/* 866 */       dataOut.writeDouble(array[i]);
/* 867 */     dataOut.close();
/*     */
/* 869 */     out.writeInt(byteStream.size());
/* 870 */     out.write(byteStream.toByteArray());
/*     */   }
View Full Code Here

    dos.writeFloat(p1Pot);
    dos.writeFloat(p2Pot);
    dos.writeInt(startClusterPDT.length);
    for(int i = 0; i < startClusterPDT.length; i++) {
      for(int j = 0; j < startClusterPDT[0].length; j++) {
        dos.writeDouble(startClusterPDT[i][j]);
      }
    }
   
    dos.close();
    fos.close();
View Full Code Here

            canon.write(v);
        }
        {
            double v = rnd.nextDouble();
            test.writeDouble(v);
            canon.writeDouble(v);
        }
        {
            float v = (float) rnd.nextDouble();
            test.writeFloat(v);
            canon.writeFloat(v);
View Full Code Here

          query += " FROM " + SQLUtils.quoteSchemaTable(conn, schema, table);
          query += " ORDER BY " + SQLUtils.quoteSymbol(conn, SQLGeometryStreamDestination.TILE_ID.toLowerCase());
          rs = stmt.executeQuery(query);
          while (rs.next())
          {
            data.writeDouble(rs.getDouble(1));
            data.writeDouble(rs.getDouble(2));
            data.writeDouble(rs.getDouble(3));
            data.writeDouble(rs.getDouble(4));
            data.writeFloat(rs.getFloat(5));
          }
View Full Code Here

          query += " ORDER BY " + SQLUtils.quoteSymbol(conn, SQLGeometryStreamDestination.TILE_ID.toLowerCase());
          rs = stmt.executeQuery(query);
          while (rs.next())
          {
            data.writeDouble(rs.getDouble(1));
            data.writeDouble(rs.getDouble(2));
            data.writeDouble(rs.getDouble(3));
            data.writeDouble(rs.getDouble(4));
            data.writeFloat(rs.getFloat(5));
          }
          return; // if this succeeds, we don't want to run the second query
View Full Code Here

          rs = stmt.executeQuery(query);
          while (rs.next())
          {
            data.writeDouble(rs.getDouble(1));
            data.writeDouble(rs.getDouble(2));
            data.writeDouble(rs.getDouble(3));
            data.writeDouble(rs.getDouble(4));
            data.writeFloat(rs.getFloat(5));
          }
          return; // if this succeeds, we don't want to run the second query
        }
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.