String s = new String(byte[] bytes);
double s = Double.parseDouble(s);
float f =  Float.parseFloat(s);        (String类构造)             Double/Float类
 byte[] ----------------> String ----------------> double/float

解决方案 »

  1.   

    //浮点到字节转换
      public static byte[] doubleToByte(double d){
        byte[] b=new byte[8];
        long l=Double.doubleToLongBits(d);
        for(int i=0;i<b.length;i++){
          b[i]=new Long(l).byteValue();
          l=l>>8;
        }
        return b;
      }  //字节到浮点转换
      public static double byteToDouble(byte[] b){
        long l;    l=b[0];
        l&=0xff;
        l|=((long)b[1]<<8);
        l&=0xffff;
        l|=((long)b[2]<<16);
        l&=0xffffff;
        l|=((long)b[3]<<24);
        l&=0xffffffffl;
        l|=((long)b[4]<<32);
        l&=0xffffffffffl;    l|=((long)b[5]<<40);
        l&=0xffffffffffffl;
        l|=((long)b[6]<<48);
        l&=0xffffffffffffffl;
        l|=((long)b[7]<<56);
        return Double.longBitsToDouble(l);
      }
      

  2.   

    public static byte[] doubleToBytes(double db)
        {
            Double d=new Double(db);
            long l=d.doubleToRawLongBits(db);
            byte[] b=new byte[8];        for(int i=0;i<8;i++)
            {
                b[i] = (byte)(l&0xff);
                l = l>>>8;
            }
        return b;
        }
        public static double byteToDouble(byte[] b)throws NumberFormatException
        {
            if (b == null || b.length < 8)
                throw new NumberFormatException();
            long lval = 0;
            for (int i = 0; i < 8; i++)
            {
                lval = lval << 8;
                lval += (b[ (7 - i)]);
            }
            return Double.longBitsToDouble(lval);
        }
      

  3.   

    String s = new String(byte[8] bytes);
    double s = Double.parseDouble(s);
    float f =  Float.parseFloat(s);
    Integer i=Integet.parseInt(s);
      

  4.   

    Double、Float等Number对象都有个byteValue()方法
    Byte对象有相应的doubleValue()、floatValue()等方法
    你要做的就是把double封装成Double对象、float封装成Float对象、byte封装成Byte对象等
    具体方法应该不用我说了吧,new一下就行了