Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid FileOutputStream.write: got java.io.IOException: Math result not representable
    text
    copied!<p>I got that "interesting" exception in my in-the-wild server errorlog. My app posts exceptions and "wtf"-errors to my central server, so I don't have much information what <em>exactly</em> happend. I just know THAT it happend, and I don't have any clue.</p> <p>Stacktrace:</p> <p><code> java.io.IOException: Math result not representable at org.apache.harmony.luni.platform.OSFileSystem.writeImpl(Native Method) at org.apache.harmony.luni.platform.OSFileSystem.write(OSFileSystem.java:129) at java.io.FileOutputStream.write(FileOutputStream.java:297) at net.jav.apps.romeolive.RomeoInterface.fetchBinaryToFile(RomeoInterface.java:299) at net.jav.apps.romeolive.HeartBeatService$_fetchPic.run(HeartBeatService.java:327) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561) at java.lang.Thread.run(Thread.java:1096) </code></p> <p>The code in place of net.jav.apps.romeolive.RomeoInterface:</p> <p><code></p> <pre><code> byte[] ret=fetchBinary(fullurl); if (ret==null) return false; try { FileOutputStream os=new FileOutputStream(getCacheFileName(type,fullurl)); os.write(ret, 0, ret.length); </code></pre> <p></code></p> <p>The "failing" line #299 is the os.write()</p> <p>fetchBinary(url) fetches some binary file (thumbnail jpg) from a web server and returns it as a byte[], or NULL if not found/error.</p> <p>getCacheFileName(type,fullurl) returns the cacheDir() plus type plus the sanitized fullurl (removing slashes, only use the localpart of the url).</p> <p>So what exactly fails, is... Trying to write the existing thumbnail jpg byte[] to a perfectly crafted filename in cacheDir(). </p> <p>The device where this exception showed up (ONCE only until now) is: GT-I9000@samsung/GT-I9000/GT-I9000/GT-I9000:2.2.1/FROYO/XXJPY:user/release-keys</p> <p>Did anyone have this "Math result not representable" as IOException? I'd really like to nail down that thing ;) Google and Stackoverflow didn't show up anything helpful or even related.</p> <p>Thanks a lot, Oliver</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload