Even, thanks for this. I&#39;ll proceed by copying the byte array to a temp file.<div><br></div><div>Best,</div><div>Sam<br><br><div class="gmail_quote">On Mon, Jan 24, 2011 at 3:54 PM, Even Rouault <span dir="ltr">&lt;<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Sam,<br>
<br>
not all drivers support the vsi virtual file systems, such as /vsimem. And HDF4<br>
is one of those drivers (the HDF4 libs need a &quot;real&quot; filename). You can<br>
generally check if a file system supports vsi virtual file systems by issuing<br>
&quot;gdalinfo --format name_of_driver&quot;<br>
<br>
For a compatible driver (such as VRT, but not HDF4), you&#39;ll see :<br>
  Supports: Virtual IO - eg. /vsimem/<br>
<div><div></div><div class="h5"><br>
&gt; Hey all,<br>
&gt;<br>
&gt; I&#39;m working on an app that needs to pass HDF4 files (MODIS tiles) around as<br>
&gt; byte arrays, and then open them up using gdal#Open, from java. Open works<br>
&gt; great when I pass in the filepath, so I know that my gdal setup is solid.<br>
&gt;<br>
&gt; The problem is, when I turn the HDF4 file into a byte array and try to use<br>
&gt;<br>
&gt; gdal.FileFromMemBuffer(&quot;/vsimem/test.hdf&quot;, bytearray);<br>
&gt; DataSet data = gdal.Open(&quot;/vsimem/test.hdf&quot;);<br>
&gt;<br>
&gt; I get an error that reads: &quot;`/vsimem/test.hdf&#39; not recognised as a<br>
&gt; supported file format.&quot;<br>
&gt;<br>
&gt; I tried something similar, by converting<br>
&gt;<br>
&gt; &lt;VRTDataset rasterXSize=\&quot;1\&quot; rasterYSize=\&quot;1\&quot;&gt;<br>
&gt;   &lt;GeoTransform&gt;100,1,0,100,0,-1&lt;/GeoTransform&gt;<br>
&gt;   &lt;VRTRasterBand dataType=\&quot;Byte\&quot; band=\&quot;1\&quot;&gt;<br>
&gt;   &lt;/VRTRasterBand&gt;<br>
&gt; &lt;/VRTDataset&gt;<br>
&gt;<br>
&gt; to a byte array and reading it in, and that worked great.<br>
&gt;<br>
&gt; Any ideas on how to deal with this issue? I&#39;ll note that open SEES the file<br>
&gt; in the /vsimem/ directory, it just doesn&#39;t recognize it as a valid file. Is<br>
&gt; this an issue with HDF4 files, or with large binary sequences? Any ideas on<br>
&gt; how to get around this?<br>
&gt;<br>
&gt; Thanks, all,<br>
&gt; Sam<br>
</div></div></blockquote></div><br></div>