/** * Fetch a Vlen data array. * * @param globalHeapIdAddress address of the heapId, used to get the String out of the heap * @param dataType type of data * @param endian byteOrder of the data (0 = BE, 1 = LE) * @return the Array read from the heap * @throws IOException on read error */ Array getHeapDataArray(long globalHeapIdAddress, DataType dataType, int endian) throws IOException, InvalidRangeException { HeapIdentifier heapId = new HeapIdentifier(globalHeapIdAddress); if (debugHeap) { log.debug(" heapId= {}", heapId); } return getHeapDataArray(heapId, dataType, endian); // Object pa = getHeapDataArray(heapId, dataType, endian); // return Array.factory(dataType.getPrimitiveClassType(), new int[]{heapId.nelems}, pa); }
/** * Fetch a String from the heap. * * @param heapIdAddress address of the heapId, used to get the String out of the heap * @return String the String read from the heap * @throws IOException on read error */ String readHeapString(long heapIdAddress) throws IOException { H5header.HeapIdentifier heapId = new HeapIdentifier(heapIdAddress); H5header.GlobalHeap.HeapObject ho = heapId.getHeapObject(); if (ho == null) throw new IllegalStateException("Cant find Heap Object,heapId="+heapId); if (ho.dataSize > 1000 * 1000) return String.format("Bad HeapObject.dataSize=%s", ho); raf.seek(ho.dataPos); return readStringFixedLength((int) ho.dataSize); }
GlobalHeap.HeapObject getHeapObject() throws IOException { if (isEmpty()) return null; GlobalHeap gheap; if (null == (gheap = heapMap.get(heapAddress))) { gheap = new GlobalHeap(heapAddress); heapMap.put(heapAddress, gheap); } for (GlobalHeap.HeapObject ho : gheap.hos) {// this is pretty lame - linear search ! if (ho.id == index) return ho; } throw new IllegalStateException("cant find HeapObject"); }
Array getHeapDataArray(HeapIdentifier heapId, DataType dataType, int endian) throws IOException, InvalidRangeException { GlobalHeap.HeapObject ho = heapId.getHeapObject(); if (ho == null) { throw new InvalidRangeException("Illegal Heap address = " + ho);
Array getHeapDataArray(HeapIdentifier heapId, DataType dataType, int endian) throws IOException, InvalidRangeException { GlobalHeap.HeapObject ho = heapId.getHeapObject(); if (ho == null) { throw new InvalidRangeException("Illegal Heap address, HeapObject = " + heapId);
Array getHeapDataArray(HeapIdentifier heapId, DataType dataType, int endian) throws IOException, InvalidRangeException { GlobalHeap.HeapObject ho = heapId.getHeapObject(); if (ho == null) { throw new InvalidRangeException("Illegal Heap address, HeapObject = " + heapId);
/** * Fetch a Vlen data array. * * @param globalHeapIdAddress address of the heapId, used to get the String out of the heap * @param dataType type of data * @param endian byteOrder of the data (0 = BE, 1 = LE) * @return String the String read from the heap * @throws IOException on read error */ Array getHeapDataArray(long globalHeapIdAddress, DataType dataType, int endian) throws IOException, InvalidRangeException { HeapIdentifier heapId = new HeapIdentifier(globalHeapIdAddress); if (debugHeap) debugOut.println(" heapId= " + heapId); return getHeapDataArray(heapId, dataType, endian); // Object pa = getHeapDataArray(heapId, dataType, endian); // return Array.factory(dataType.getPrimitiveClassType(), new int[]{heapId.nelems}, pa); }
/** * Fetch a Vlen data array. * * @param globalHeapIdAddress address of the heapId, used to get the String out of the heap * @param dataType type of data * @param endian byteOrder of the data (0 = BE, 1 = LE) * @return the Array read from the heap * @throws IOException on read error */ Array getHeapDataArray(long globalHeapIdAddress, DataType dataType, int endian) throws IOException, InvalidRangeException { HeapIdentifier heapId = new HeapIdentifier(globalHeapIdAddress); if (debugHeap) debugOut.println(" heapId= " + heapId); return getHeapDataArray(heapId, dataType, endian); // Object pa = getHeapDataArray(heapId, dataType, endian); // return Array.factory(dataType.getPrimitiveClassType(), new int[]{heapId.nelems}, pa); }
/** * Fetch a String from the heap, when the heap identifier has already beed read into a ByteBuffer at given pos * * @param bb heap id is here * @param pos at this position * @return String the String read from the heap * @throws IOException on read error */ String readHeapString(ByteBuffer bb, int pos) throws IOException { H5header.HeapIdentifier heapId = new HeapIdentifier(bb, pos); H5header.GlobalHeap.HeapObject ho = heapId.getHeapObject(); if (ho == null) throw new IllegalStateException("Cant find Heap Object,heapId="+heapId); // if (H5iosp.debugHeapStrings) System.out.printf(" readHeapString ho=%s%n", ho); raf.seek(ho.dataPos); return readStringFixedLength((int) ho.dataSize); }
Array readHeapVlen(ByteBuffer bb, int pos, DataType dataType, int endian) throws IOException, InvalidRangeException { H5header.HeapIdentifier heapId = new HeapIdentifier(bb, pos); return getHeapDataArray(heapId, dataType, endian); }
/** * Fetch a String from the heap, when the heap identifier has already beed read into a ByteBuffer at given pos * @param bb heap id is here * @param pos at this position * @return String the String read from the heap * @throws IOException on read error */ String readHeapString(ByteBuffer bb, int pos) throws IOException { H5header.HeapIdentifier heapId = new HeapIdentifier(bb, pos); H5header.GlobalHeap.HeapObject ho = heapId.getHeapObject(); raf.seek(ho.dataPos); return readStringFixedLength((int) ho.dataSize); }
GlobalHeap.HeapObject getHeapObject() throws IOException { if (isEmpty()) return null; GlobalHeap gheap; if (null == (gheap = heapMap.get(heapAddress))) { gheap = new GlobalHeap(heapAddress); heapMap.put(heapAddress, gheap); } for (GlobalHeap.HeapObject ho : gheap.hos) {// this is pretty lame - linear search ! if (ho.id == index) return ho; } throw new IllegalStateException("cant find HeapObject"); }
Array readHeapVlen(ByteBuffer bb, int pos, DataType dataType, int endian) throws IOException, InvalidRangeException { H5header.HeapIdentifier heapId = new HeapIdentifier(bb, pos); return getHeapDataArray(heapId, dataType, endian); }
/** * Fetch a String from the heap. * * @param heapIdAddress address of the heapId, used to get the String out of the heap * @return String the String read from the heap * @throws IOException on read error */ String readHeapString(long heapIdAddress) throws IOException { H5header.HeapIdentifier heapId = new HeapIdentifier(heapIdAddress); H5header.GlobalHeap.HeapObject ho = heapId.getHeapObject(); raf.seek(ho.dataPos); return readStringFixedLength((int) ho.dataSize); }
GlobalHeap.HeapObject getHeapObject() throws IOException { if (isEmpty()) return null; GlobalHeap gheap; if (null == (gheap = heapMap.get(heapAddress))) { gheap = new GlobalHeap(heapAddress); heapMap.put(heapAddress, gheap); } GlobalHeap.HeapObject ho = gheap.getHeapObject((short) index); if (ho == null) throw new IllegalStateException("cant find HeapObject"); return ho; }
Array readHeapVlen(ByteBuffer bb, int pos, DataType dataType, int endian) throws IOException, InvalidRangeException { H5header.HeapIdentifier heapId = new HeapIdentifier(bb, pos); return getHeapDataArray(heapId, dataType, endian); }
/** * Fetch a String from the heap, when the heap identifier has already beed read into a ByteBuffer at given pos * * @param bb heap id is here * @param pos at this position * @return String the String read from the heap * @throws IOException on read error */ String readHeapString(ByteBuffer bb, int pos) throws IOException { H5header.HeapIdentifier heapId = new HeapIdentifier(bb, pos); H5header.GlobalHeap.HeapObject ho = heapId.getHeapObject(); if (ho == null) throw new IllegalStateException("Cant find Heap Object,heapId="+heapId); raf.seek(ho.dataPos); return readStringFixedLength((int) ho.dataSize); }
/** * Fetch a String from the heap. * * @param heapIdAddress address of the heapId, used to get the String out of the heap * @return String the String read from the heap * @throws IOException on read error */ String readHeapString(long heapIdAddress) throws IOException { H5header.HeapIdentifier heapId = new HeapIdentifier(heapIdAddress); H5header.GlobalHeap.HeapObject ho = heapId.getHeapObject(); if (ho == null) throw new IllegalStateException("Cant find Heap Object,heapId="+heapId); raf.seek(ho.dataPos); return readStringFixedLength((int) ho.dataSize); }