0

First I converted a byte array to a double array to make same math operations (see code below):

private double[] bytesToDouble(File file){

    InputStream in = null;
    if (file.isFile()) {
        long size = file.length();
        try {
            in = new FileInputStream(file);
            return readStreamAsDoubleArray(in, size);
        } catch (Exception e) {
        }
    }
    return null;

}

Now I would like to convert it back into a byte array to save it again to a wav file. How do I do that? The problem is that I have a double array and in the answer the use a double value, but not a double array. Thats why the following answer doesnt help me: How can I convert a byte array into a double and back?

Florian
  • 33
  • 1
  • 8
  • 1
    https://stackoverflow.com/questions/2905556/how-can-i-convert-a-byte-array-into-a-double-and-back – AskNilesh Apr 18 '18 at 08:15
  • Thanks for answering, the problem is that I have a double array and in the answer the use a double value, but not a double array – Florian Apr 18 '18 at 08:24
  • Possible duplicate of [How can I convert a byte array into a double and back?](https://stackoverflow.com/questions/2905556/how-can-i-convert-a-byte-array-into-a-double-and-back) – Reaz Murshed Apr 18 '18 at 08:25
  • According to my previous commentary it explains why this question doen`t help me. – Florian Apr 18 '18 at 08:32
  • Show the code of `readStreamAsDoubleArray()`.Show how you convert a byte to a double. – greenapps Apr 18 '18 at 10:14
  • And show how you want a double to be converted to a byte. Not every double value can be converted to a byte. How do you wanna manage that? – greenapps Apr 18 '18 at 10:15

0 Answers0