boolean isNeeded(Section wantSection) throws InvalidRangeException { return section.intersects(wantSection); }
boolean isNeeded(Section wantSection) throws InvalidRangeException { return section.intersects(wantSection); }
boolean isNeeded(Section wantSection) throws InvalidRangeException { return section.intersects(wantSection); }
public Array readData(Variable v, Section section) throws IOException, InvalidRangeException { List<DataStorage> storage = (List<DataStorage>) v.getSPobject(); ByteBuffer result = null; for (DataStorage dataStorage : storage) { //if (dataStorage.isVlen) // return readVlenData(v, section, dataStorage); if (dataStorage.section.intersects(section)) { // LOOK WRONG raf.seek(dataStorage.filePos); byte[] data = new byte[dataStorage.size]; raf.read(data); if (dataStorage.isDeflate) { ByteArrayInputStream bin = new ByteArrayInputStream(data); InflaterInputStream in = new InflaterInputStream(bin); ByteArrayOutputStream bout = new ByteArrayOutputStream(data.length * 7); IO.copy(in, bout); byte[] resultb = bout.toByteArray(); result = ByteBuffer.wrap(resultb); // look - an extra copy !! override ByteArrayOutputStream to fix if (debug) System.out.printf(" uncompressedLen header=%d actual=%d%n", dataStorage.uncompressedLen , resultb.length); //result.order(ByteOrder.LITTLE_ENDIAN); // LOOK } else { result = ByteBuffer.wrap(data); } } } return Array.factory(v.getDataType(), v.getShape(), result); //return dataArray.sectionNoReduce(section.getRanges()); }
public Array readData(Variable v, Section section) throws IOException, InvalidRangeException { List<DataStorage> storage = (List<DataStorage>) v.getSPobject(); ByteBuffer result = null; for (DataStorage dataStorage : storage) { //if (dataStorage.isVlen) // return readVlenData(v, section, dataStorage); if (dataStorage.section.intersects(section)) { // LOOK WRONG raf.seek(dataStorage.filePos); byte[] data = new byte[dataStorage.size]; raf.readFully(data); if (dataStorage.isDeflate) { ByteArrayInputStream bin = new ByteArrayInputStream(data); InflaterInputStream in = new InflaterInputStream(bin); ByteArrayOutputStream bout = new ByteArrayOutputStream(data.length * 7); IO.copy(in, bout); byte[] resultb = bout.toByteArray(); result = ByteBuffer.wrap(resultb); // look - an extra copy !! override ByteArrayOutputStream to fix if (debug) System.out.printf(" uncompressedLen header=%d actual=%d%n", dataStorage.uncompressedLen , resultb.length); //result.order(ByteOrder.LITTLE_ENDIAN); // LOOK } else { result = ByteBuffer.wrap(data); } } } if (result == null) return null; return Array.factory(v.getDataType(), v.getShape(), result); //return dataArray.sectionNoReduce(section.getRanges()); }
if (dataStorage.section.intersects(section)) { // LOOK WRONG raf.seek(dataStorage.filePos); byte[] data = new byte[dataStorage.size];
public void testIntersect() throws InvalidRangeException { Section have = new Section("101:101,0:1919"); Section want = new Section("100:229:3,100:191:7"); boolean b = have.intersects( want); assert !b; }
if (debugIntersection) System.out.println(" test intersecting: " + dataSection + " want: " + want); if (dataSection.intersects(want)) // does it intersect ? break;
if (dataSection.intersects(want)) // does it intersect ? break;
if (dataSection.intersects(want)) // does it intersect ? break;
if (dataSection.intersects(want)) // does it intersect ? break;
if (debugIntersection) System.out.println(" test intersecting: " + dataSection + " want: " + want); if (dataSection.intersects(want)) // does it intersect ? break;
if (debugIntersection) System.out.println(" test intersecting: " + dataSection + " want: " + want); if (dataSection.intersects(want)) // does it intersect ? break;
if (!tiledSection.intersects(wantSection)) continue;
if (!tiledSection.intersects(wantSection)) continue;
if (!tiledSection.intersects(wantSection)) continue;