java.io.IOException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Android SDK queryRelated objects fails with java.io.IOException
    via Geographic Information Systems by kescalera84
    ,
  • IOException on Movie.decodeFile() - android
    via Stack Overflow by Ganesh
    ,
  • IOException - Cannot load file
    via Stack Overflow by Bojan Kogoj
    ,
  • Load gif image from sdcard - android
    via Stack Overflow by RVG
    ,
  • Resolving TIMOB-23230 brought attention to this error. Logs as follows:- {code} ERROR] : TiBlob: (main) [449,5770] null [ERROR] : TiBlob: java.io.IOException [ERROR] : TiBlob: at java.io.InputStream.reset(InputStream.java:208) [ERROR] : TiBlob: at org.appcelerator.titanium.TiBlob.guessAdditionalContentTypeFromStream(TiBlob.java:239) [ERROR] : TiBlob: at org.appcelerator.titanium.TiBlob.guessContentTypeFromStream(TiBlob.java:214) [ERROR] : TiBlob: at org.appcelerator.titanium.TiBlob.loadBitmapInfo(TiBlob.java:270) [ERROR] : TiBlob: at org.appcelerator.titanium.TiBlob.blobFromFile(TiBlob.java:140) [ERROR] : TiBlob: at org.appcelerator.titanium.TiBlob.blobFromFile(TiBlob.java:113) [ERROR] : TiBlob: at ti.modules.titanium.media.TiCameraActivity$3.onPictureTaken(TiCameraActivity.java:563) [ERROR] : TiBlob: at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1092) [ERROR] : TiBlob: at android.os.Handler.dispatchMessage(Handler.java:102) [ERROR] : TiBlob: at android.os.Looper.loop(Looper.java:148) [ERROR] : TiBlob: at android.app.ActivityThread.main(ActivityThread.java:5417) [ERROR] : TiBlob: at java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiBlob: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) [ERROR] : TiBlob: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) {code} This was tested on an Android 6.0, Nexus 6. Test code as follows:- {code} var window = Ti.UI.createWindow(); var overlay = Ti.UI.createView(); var button = Titanium.UI.createButton({ color : '#fff', bottom : "10dp", width : "130dp", height : "50dp", font : { fontSize : "14dp", fontWeight : 'bold', fontFamily : 'Helvetica Neue' }, title : 'Take Picture' }); button.addEventListener('click', function() { Ti.Media.takePicture(); }); window.add(overlay); overlay.add(button); window.addEventListener('open', function(e){ var cameraPermission = "android.permission.CAMERA"; var storagePermission = "android.permission.READ_EXTERNAL_STORAGE"; var hasCameraPerm = Ti.Android.hasPermission(cameraPermission); var hasStoragePerm = Ti.Android.hasPermission(storagePermission); var permissionsToRequest = []; if (!hasCameraPerm) { permissionsToRequest.push(cameraPermission); } if (!hasStoragePerm) { permissionsToRequest.push(storagePermission); } if (permissionsToRequest.length > 0) { Ti.Android.requestPermissions(permissionsToRequest, function(e) { if (e.success) { showCamera(); } else { Ti.API.info("ERROR: " + e.error); } }); } else { showCamera(); } }); Ti.Media.addEventListener('cameraready', function(e){ Ti.Media.takePicture(); }); var container = Ti.UI.createView({ top:'10%', height:'80%' }); var img = Ti.UI.createImageView({ }); container.add(img); window.add(container); window.open(); function showCamera() { Ti.Media.showCamera({ success : function(e) { Ti.API.info('GOT SUCCESS CALLBACK'); var imgWid = e.media.width; var imgHeight = e.media.height; var mSize = container.size; var mW = mSize.width; var mH = mSize.height; var wS = imgWid/mW; var hS = imgHeight/mH; var tS = (wS < hS) ? wS : hS; var dstWid = imgWid/tS; var dstHeight = imgHeight/ tS; Ti.API.info(imgWid+' '+imgHeight+' '+mW+' '+mH+' '+wS+' '+hS+' '+tS+' '+dstWid+' '+dstHeight); var resize = e.media.imageAsResized(dstWid,dstHeight); img.image = resize; }, overlay : overlay, mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO], saveToPhotoGallery : true }); } {code}
    via by Ashraf Abu,
  • loading large bitmaps efficiently android
    via Stack Overflow by ant
    ,
  • Resolving TIMOB-23230 brought attention to this error. Logs as follows:- {code} ERROR] : TiBlob: (main) [449,5770] null [ERROR] : TiBlob: java.io.IOException [ERROR] : TiBlob: at java.io.InputStream.reset(InputStream.java:208) [ERROR] : TiBlob: at org.appcelerator.titanium.TiBlob.guessAdditionalContentTypeFromStream(TiBlob.java:239) [ERROR] : TiBlob: at org.appcelerator.titanium.TiBlob.guessContentTypeFromStream(TiBlob.java:214) [ERROR] : TiBlob: at org.appcelerator.titanium.TiBlob.loadBitmapInfo(TiBlob.java:270) [ERROR] : TiBlob: at org.appcelerator.titanium.TiBlob.blobFromFile(TiBlob.java:140) [ERROR] : TiBlob: at org.appcelerator.titanium.TiBlob.blobFromFile(TiBlob.java:113) [ERROR] : TiBlob: at ti.modules.titanium.media.TiCameraActivity$3.onPictureTaken(TiCameraActivity.java:563) [ERROR] : TiBlob: at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1092) [ERROR] : TiBlob: at android.os.Handler.dispatchMessage(Handler.java:102) [ERROR] : TiBlob: at android.os.Looper.loop(Looper.java:148) [ERROR] : TiBlob: at android.app.ActivityThread.main(ActivityThread.java:5417) [ERROR] : TiBlob: at java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiBlob: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) [ERROR] : TiBlob: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) {code} This was tested on an Android 6.0, Nexus 6. Test code as follows:- {code} var window = Ti.UI.createWindow(); var overlay = Ti.UI.createView(); var button = Titanium.UI.createButton({ color : '#fff', bottom : "10dp", width : "130dp", height : "50dp", font : { fontSize : "14dp", fontWeight : 'bold', fontFamily : 'Helvetica Neue' }, title : 'Take Picture' }); button.addEventListener('click', function() { Ti.Media.takePicture(); }); window.add(overlay); overlay.add(button); window.addEventListener('open', function(e){ var cameraPermission = "android.permission.CAMERA"; var storagePermission = "android.permission.READ_EXTERNAL_STORAGE"; var hasCameraPerm = Ti.Android.hasPermission(cameraPermission); var hasStoragePerm = Ti.Android.hasPermission(storagePermission); var permissionsToRequest = []; if (!hasCameraPerm) { permissionsToRequest.push(cameraPermission); } if (!hasStoragePerm) { permissionsToRequest.push(storagePermission); } if (permissionsToRequest.length > 0) { Ti.Android.requestPermissions(permissionsToRequest, function(e) { if (e.success) { showCamera(); } else { Ti.API.info("ERROR: " + e.error); } }); } else { showCamera(); } }); Ti.Media.addEventListener('cameraready', function(e){ Ti.Media.takePicture(); }); var container = Ti.UI.createView({ top:'10%', height:'80%' }); var img = Ti.UI.createImageView({ }); container.add(img); window.add(container); window.open(); function showCamera() { Ti.Media.showCamera({ success : function(e) { Ti.API.info('GOT SUCCESS CALLBACK'); var imgWid = e.media.width; var imgHeight = e.media.height; var mSize = container.size; var mW = mSize.width; var mH = mSize.height; var wS = imgWid/mW; var hS = imgHeight/mH; var tS = (wS < hS) ? wS : hS; var dstWid = imgWid/tS; var dstHeight = imgHeight/ tS; Ti.API.info(imgWid+' '+imgHeight+' '+mW+' '+mH+' '+wS+' '+hS+' '+tS+' '+dstWid+' '+dstHeight); var resize = e.media.imageAsResized(dstWid,dstHeight); img.image = resize; }, overlay : overlay, mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO], saveToPhotoGallery : true }); } {code}
    via by Ashraf Abu,
  • BNF reports problems crawling http://presse.parti-socialiste.fr/ and related sites. Turns out http://presse.parti-socialiste.fr/ is returning 'Transfer-encoding: chunked' (an HTTP/1.1 feature) even though Heritrix's request is HTTP/1.0. This server behavior is counter to the HTTP/1.1 specification; see <http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6>, which says: "A server MUST NOT send transfer-codings to an HTTP/1.0 client.") When the HTTPClient library sees that encoding, it attempts to use mark/reset functionality on the connection's inputstream. That would be fine with the usual buffered inputstream, but our inserted recording functionality doesn't offer mark/reset -- and this is the first time that limitation has bit us. The exception stack is: 2007-03-23T01:30:50.048Z -2 1 http://presse.parti-socialiste.fr/ - - text/html #002 - - - le:IOException@HTTP java.io.IOException: mark/reset not supported at java.io.InputStream.reset(InputStream.java:331) at org.apache.commons.httpclient.HttpConnection.isResponseAvailable(HttpConnection.java:933) at org.apache.commons.httpclient.HttpMethodBase.readResponseBody(HttpMethodBase.java:1719) at org.apache.commons.httpclient.HttpMethodBase.readResponseBody(HttpMethodBase.java:1662) at org.archive.httpclient.HttpRecorderGetMethod.readResponseBody(HttpRecorderGetMethod.java:98) at org.archive.crawler.fetcher.FetchHTTP$2.readResponseBody(FetchHTTP.java:472) at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1625) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1002) at org.archive.httpclient.HttpRecorderGetMethod.execute(HttpRecorderGetMethod.java:116) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346) at org.archive.crawler.fetcher.FetchHTTP.innerProcess(FetchHTTP.java:489) at org.archive.crawler.framework.Processor.process(Processor.java:109) at org.archive.crawler.framework.ToeThread.processCrawlUri(ToeThread.java:302) at org.archive.crawler.framework.ToeThread.run(ToeThread.java:151) Even though this site violates HTTP/1.1, we want to be able to get it and others like it, and the HTTPClient library can handle chunked encoding if we help it with a suitable stream. It appears enough to rearrange the order of stream-wrapping in HttpConnection.open(), putting our recording-streams inside rather than outside the buffered streams. Then the expected mark/reset functionality is available, there is no IOException, and collection succeeds.
    via by Gordon Mohr,
    • java.io.IOException at java.io.InputStream.reset(InputStream.java:218) at com.esri.core.geodatabase.GeodatabaseFeatureServiceTable.a(SourceFile:946) at com.esri.core.geodatabase.GeodatabaseFeatureServiceTable.a(SourceFile:113) at com.esri.core.geodatabase.GeodatabaseFeatureServiceTable$2.a(SourceFile:2159) at com.esri.core.geodatabase.GeodatabaseFeatureServiceTable$2.call(SourceFile:2114) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) at java.util.concurrent.FutureTask.run(FutureTask.java:137) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) at java.lang.Thread.run(Thread.java:856)
    No Bugmate found.