List<DataChunk> getDataChunks() throws IOException { if (dataChunks == null) { dataChunks = new ArrayList<DataChunk>(); // read the chunk table - stored as a Structure in the data if (debugChunkTable) System.out.println(" TagData getChunkedTable " + detail()); TagVH chunkTableTag = (TagVH) tagMap.get(tagid(chunk_tbl_ref, chunk_tbl_tag)); Structure s = (Structure) makeVariable(chunkTableTag); ArrayStructure sdata = (ArrayStructure) s.read(); if (debugChunkDetail) System.out.println(NCdumpW.printArray(sdata, "getChunkedTable", null)); // construct the chunks StructureMembers members = sdata.getStructureMembers(); StructureMembers.Member originM = members.findMember("origin"); StructureMembers.Member tagM = members.findMember("chk_tag"); StructureMembers.Member refM = members.findMember("chk_ref"); int n = (int) sdata.getSize(); if (debugChunkTable) System.out.println(" Reading " + n + " DataChunk tags"); for (int i = 0; i < n; i++) { //if (i == 341) //System.out.println("HEYA"); int[] origin = sdata.getJavaArrayInt(i, originM); short tag = sdata.getScalarShort(i, tagM); short ref = sdata.getScalarShort(i, refM); TagData data = (TagData) tagMap.get(tagid(ref, tag)); dataChunks.add(new DataChunk(origin, chunk_length, data)); data.used = true; if (data.compress != null) isCompressed = true; } } return dataChunks; }
void setLayoutInfo() throws IOException { if (data == null) return; if (null != data.linked) { isLinked = true; setDataBlocks(data.linked.getLinkedDataBlocks(), elemSize); } else if (null != data.compress) { isCompressed = true; TagData compData = data.compress.getDataTag(); tags.add(compData); isLinked = (compData.linked != null); if (isLinked) setDataBlocks(compData.linked.getLinkedDataBlocks(), elemSize); else { start = compData.offset; length = compData.length; hasNoData = (start < 0) || (length < 0); } } else if (null != data.chunked) { isChunked = true; chunks = data.chunked.getDataChunks(); chunkSize = data.chunked.chunk_length; isCompressed = data.chunked.isCompressed; } else { start = data.offset; hasNoData = (start < 0); } }
void setLayoutInfo() throws IOException { if (data == null) return; if (null != data.linked) { isLinked = true; setDataBlocks(data.linked.getLinkedDataBlocks(), elemSize); } else if (null != data.compress) { isCompressed = true; TagData compData = data.compress.getDataTag(); tags.add(compData); isLinked = (compData.linked != null); if (isLinked) setDataBlocks(compData.linked.getLinkedDataBlocks(), elemSize); else { start = compData.offset; length = compData.length; hasNoData = (start < 0) || (length < 0); } } else if (null != data.chunked) { isChunked = true; chunks = data.chunked.getDataChunks(); chunkSize = data.chunked.chunk_length; isCompressed = data.chunked.isCompressed; } else { start = data.offset; hasNoData = (start < 0); } }
void setLayoutInfo() throws IOException { if (data == null) return; if (null != data.linked) { isLinked = true; setDataBlocks(data.linked.getLinkedDataBlocks(), elemSize); } else if (null != data.compress) { isCompressed = true; TagData compData = data.compress.getDataTag(); tags.add(compData); isLinked = (compData.linked != null); if (isLinked) setDataBlocks(compData.linked.getLinkedDataBlocks(), elemSize); else { start = compData.offset; length = compData.length; hasNoData = (start < 0) || (length < 0); } } else if (null != data.chunked) { isChunked = true; chunks = data.chunked.getDataChunks(); chunkSize = data.chunked.chunk_length; isCompressed = data.chunked.isCompressed; } else { start = data.offset; hasNoData = (start < 0); } }
if (debugChunkTable) System.out.println(" TagData getChunkedTable " + detail()); TagVH chunkTableTag = (TagVH) tagMap.get(tagid(chunk_tbl_ref, chunk_tbl_tag)); Structure s = (Structure) makeVariable(chunkTableTag);
List<DataChunk> getDataChunks() throws IOException { if (dataChunks == null) { dataChunks = new ArrayList<DataChunk>(); // read the chunk table - stored as a Structure in the data if (debugChunkTable) System.out.println(" TagData getChunkedTable " + detail()); TagVH chunkTableTag = (TagVH) tagMap.get(tagid(chunk_tbl_ref, chunk_tbl_tag)); Structure s = (Structure) makeVariable(chunkTableTag); ArrayStructure sdata = (ArrayStructure) s.read(); if (debugChunkDetail) System.out.println(NCdumpW.toString(sdata, "getChunkedTable", null)); // construct the chunks StructureMembers members = sdata.getStructureMembers(); StructureMembers.Member originM = members.findMember("origin"); StructureMembers.Member tagM = members.findMember("chk_tag"); StructureMembers.Member refM = members.findMember("chk_ref"); int n = (int) sdata.getSize(); if (debugChunkTable) System.out.println(" Reading " + n + " DataChunk tags"); for (int i = 0; i < n; i++) { //if (i == 341) //System.out.println("HEYA"); int[] origin = sdata.getJavaArrayInt(i, originM); short tag = sdata.getScalarShort(i, tagM); short ref = sdata.getScalarShort(i, refM); TagData data = (TagData) tagMap.get(tagid(ref, tag)); dataChunks.add(new DataChunk(origin, chunk_length, data)); data.used = true; if (data.compress != null) isCompressed = true; } } return dataChunks; }
protected void read() throws IOException { if (extended) { raf.seek(offset); ext_type = raf.readShort(); // note size wrong in doc if (ext_type == TagEnum.SPECIAL_LINKED) { linked = new SpecialLinked(); linked.read(); } else if (ext_type == TagEnum.SPECIAL_COMP) { compress = new SpecialComp(); compress.read(); } else if (ext_type == TagEnum.SPECIAL_CHUNKED) { chunked = new SpecialChunked(); chunked.read(); } tag_len = (int) (raf.getFilePointer() - offset); } }
void read() throws IOException { if (extended) { raf.seek(offset); ext_type = raf.readShort(); // note size wrong in doc if (ext_type == TagEnum.SPECIAL_LINKED) { linked = new SpecialLinked(); linked.read(); } else if (ext_type == TagEnum.SPECIAL_COMP) { compress = new SpecialComp(); compress.read(); } else if (ext_type == TagEnum.SPECIAL_CHUNKED) { chunked = new SpecialChunked(); chunked.read(); } tag_len = (int) (raf.getFilePointer() - offset); } }
void read() throws IOException { if (extended) { raf.seek(offset); ext_type = raf.readShort(); // note size wrong in doc if (ext_type == TagEnum.SPECIAL_LINKED) { linked = new SpecialLinked(); linked.read(); } else if (ext_type == TagEnum.SPECIAL_COMP) { compress = new SpecialComp(); compress.read(); } else if (ext_type == TagEnum.SPECIAL_CHUNKED) { chunked = new SpecialChunked(); chunked.read(); } tag_len = (int) (raf.getFilePointer() - offset); } }
public String detail() { if (linked != null) return super.detail() + " ext_tag= " + ext_type + " tag_len= " + tag_len + " " + linked.detail(); else if (compress != null) return super.detail() + " ext_tag= " + ext_type + " tag_len= " + tag_len + " " + compress.detail(); else if (chunked != null) return super.detail() + " ext_tag= " + ext_type + " tag_len= " + tag_len + " " + chunked.detail(); else return super.detail(); }
public String detail() { if (linked != null) return super.detail() + " ext_tag= " + ext_type + " tag_len= " + tag_len + " " + linked.detail(); else if (compress != null) return super.detail() + " ext_tag= " + ext_type + " tag_len= " + tag_len + " " + compress.detail(); else if (chunked != null) return super.detail() + " ext_tag= " + ext_type + " tag_len= " + tag_len + " " + chunked.detail(); else return super.detail(); }
public String detail() { if (linked != null) return super.detail() + " ext_tag= " + ext_type + " tag_len= " + tag_len + " " + linked.detail(); else if (compress != null) return super.detail() + " ext_tag= " + ext_type + " tag_len= " + tag_len + " " + compress.detail(); else if (chunked != null) return super.detail() + " ext_tag= " + ext_type + " tag_len= " + tag_len + " " + chunked.detail(); else return super.detail(); }