Skip to content
Permalink
Browse files

Merge pull request #111 from jamesmudd/code-cleanup

Code cleanup
  • Loading branch information...
jamesmudd committed Oct 3, 2019
2 parents 39996cb + c99739b commit c4cc39c7c4ea899761e63217e047db6caeb5d4f7
Showing with 1,044 additions and 1,114 deletions.
  1. +2 −2 jhdf/config/checkstyle/header.txt
  2. +14 −15 jhdf/src/main/java/io/jhdf/AbstractNode.java
  3. +8 −9 jhdf/src/main/java/io/jhdf/AttributeImpl.java
  4. +2 −2 jhdf/src/main/java/io/jhdf/Constants.java
  5. +15 −18 jhdf/src/main/java/io/jhdf/FractalHeap.java
  6. +6 −6 jhdf/src/main/java/io/jhdf/GlobalHeap.java
  7. +13 −14 jhdf/src/main/java/io/jhdf/GroupImpl.java
  8. +6 −7 jhdf/src/main/java/io/jhdf/GroupSymbolTableNode.java
  9. +16 −19 jhdf/src/main/java/io/jhdf/HdfFile.java
  10. +4 −4 jhdf/src/main/java/io/jhdf/HdfFileChannel.java
  11. +5 −6 jhdf/src/main/java/io/jhdf/LocalHeap.java
  12. +11 −14 jhdf/src/main/java/io/jhdf/ObjectHeader.java
  13. +8 −9 jhdf/src/main/java/io/jhdf/Superblock.java
  14. +5 −5 jhdf/src/main/java/io/jhdf/SymbolTableEntry.java
  15. +4 −4 jhdf/src/main/java/io/jhdf/Utils.java
  16. +2 −2 jhdf/src/main/java/io/jhdf/api/Attribute.java
  17. +2 −2 jhdf/src/main/java/io/jhdf/api/Dataset.java
  18. +4 −4 jhdf/src/main/java/io/jhdf/api/Group.java
  19. +2 −2 jhdf/src/main/java/io/jhdf/api/Link.java
  20. +4 −4 jhdf/src/main/java/io/jhdf/api/Node.java
  21. +2 −2 jhdf/src/main/java/io/jhdf/api/NodeType.java
  22. +2 −2 jhdf/src/main/java/io/jhdf/api/package-info.java
  23. +8 −9 jhdf/src/main/java/io/jhdf/btree/BTreeV1.java
  24. +8 −8 jhdf/src/main/java/io/jhdf/btree/BTreeV1Data.java
  25. +5 −5 jhdf/src/main/java/io/jhdf/btree/BTreeV1Group.java
  26. +7 −7 jhdf/src/main/java/io/jhdf/btree/BTreeV2.java
  27. +2 −2 jhdf/src/main/java/io/jhdf/btree/package-info.java
  28. +5 −5 jhdf/src/main/java/io/jhdf/btree/record/AttributeNameForIndexedAttributesRecord.java
  29. +4 −4 jhdf/src/main/java/io/jhdf/btree/record/BTreeRecord.java
  30. +4 −4 jhdf/src/main/java/io/jhdf/btree/record/LinkNameForIndexedGroupRecord.java
  31. +2 −2 jhdf/src/main/java/io/jhdf/btree/record/package-info.java
  32. +2 −2 jhdf/src/main/java/io/jhdf/dataset/ChunkedDatasetV3.java
  33. +4 −4 jhdf/src/main/java/io/jhdf/dataset/CompactDataset.java
  34. +2 −2 jhdf/src/main/java/io/jhdf/dataset/CompoundDatasetReader.java
  35. +6 −6 jhdf/src/main/java/io/jhdf/dataset/ContiguousDataset.java
  36. +11 −12 jhdf/src/main/java/io/jhdf/dataset/DatasetBase.java
  37. +2 −2 jhdf/src/main/java/io/jhdf/dataset/DatasetLoader.java
  38. +12 −12 jhdf/src/main/java/io/jhdf/dataset/DatasetReader.java
  39. +2 −2 jhdf/src/main/java/io/jhdf/dataset/GlobalHeapId.java
  40. +6 −6 jhdf/src/main/java/io/jhdf/dataset/NoParent.java
  41. +7 −7 jhdf/src/main/java/io/jhdf/dataset/VariableLengthDatasetReader.java
  42. +2 −2 jhdf/src/main/java/io/jhdf/dataset/package-info.java
  43. +6 −8 jhdf/src/main/java/io/jhdf/examples/PrintTree.java
  44. +2 −2 jhdf/src/main/java/io/jhdf/examples/ReadAttribute.java
  45. +5 −6 jhdf/src/main/java/io/jhdf/examples/ReadDataset.java
  46. +2 −2 jhdf/src/main/java/io/jhdf/examples/package-info.java
  47. +2 −2 jhdf/src/main/java/io/jhdf/exceptions/HdfBrokenLinkException.java
  48. +2 −2 jhdf/src/main/java/io/jhdf/exceptions/HdfException.java
  49. +2 −2 jhdf/src/main/java/io/jhdf/exceptions/HdfFilterException.java
  50. +2 −2 jhdf/src/main/java/io/jhdf/exceptions/HdfInvalidPathException.java
  51. +2 −2 jhdf/src/main/java/io/jhdf/exceptions/HdfTypeException.java
  52. +2 −2 jhdf/src/main/java/io/jhdf/exceptions/UnsupportedHdfException.java
  53. +2 −2 jhdf/src/main/java/io/jhdf/exceptions/package-info.java
  54. +2 −2 jhdf/src/main/java/io/jhdf/filter/ByteShuffleFilter.java
  55. +6 −7 jhdf/src/main/java/io/jhdf/filter/DeflatePipelineFilter.java
  56. +2 −2 jhdf/src/main/java/io/jhdf/filter/Filter.java
  57. +9 −10 jhdf/src/main/java/io/jhdf/filter/FilterManager.java
  58. +5 −5 jhdf/src/main/java/io/jhdf/filter/FilterPipeline.java
  59. +2 −2 jhdf/src/main/java/io/jhdf/filter/FletcherChecksumFilter.java
  60. +2 −2 jhdf/src/main/java/io/jhdf/filter/package-info.java
  61. +6 −7 jhdf/src/main/java/io/jhdf/links/AbstractLink.java
  62. +6 −7 jhdf/src/main/java/io/jhdf/links/ExternalLink.java
  63. +3 −4 jhdf/src/main/java/io/jhdf/links/SoftLink.java
  64. +2 −2 jhdf/src/main/java/io/jhdf/links/package-info.java
  65. +2 −2 jhdf/src/main/java/io/jhdf/object/datatype/ArrayDataType.java
  66. +3 −3 jhdf/src/main/java/io/jhdf/object/datatype/CompoundDataType.java
  67. +5 −5 jhdf/src/main/java/io/jhdf/object/datatype/DataType.java
  68. +4 −4 jhdf/src/main/java/io/jhdf/object/datatype/FixedPoint.java
  69. +5 −5 jhdf/src/main/java/io/jhdf/object/datatype/FloatingPoint.java
  70. +2 −2 jhdf/src/main/java/io/jhdf/object/datatype/OrderedDataType.java
  71. +5 −5 jhdf/src/main/java/io/jhdf/object/datatype/Reference.java
  72. +5 −5 jhdf/src/main/java/io/jhdf/object/datatype/StringData.java
  73. +5 −5 jhdf/src/main/java/io/jhdf/object/datatype/VariableLength.java
  74. +2 −2 jhdf/src/main/java/io/jhdf/object/datatype/package-info.java
  75. +5 −5 jhdf/src/main/java/io/jhdf/object/message/AttributeInfoMessage.java
  76. +9 −10 jhdf/src/main/java/io/jhdf/object/message/AttributeMessage.java
  77. +4 −4 jhdf/src/main/java/io/jhdf/object/message/BTreeKValuesMessage.java
  78. +2 −2 jhdf/src/main/java/io/jhdf/object/message/DataLayout.java
  79. +5 −5 jhdf/src/main/java/io/jhdf/object/message/DataLayoutMessage.java
  80. +6 −6 jhdf/src/main/java/io/jhdf/object/message/DataSpace.java
  81. +4 −4 jhdf/src/main/java/io/jhdf/object/message/DataSpaceMessage.java
  82. +4 −4 jhdf/src/main/java/io/jhdf/object/message/DataTypeMessage.java
  83. +6 −7 jhdf/src/main/java/io/jhdf/object/message/FillValueMessage.java
  84. +4 −4 jhdf/src/main/java/io/jhdf/object/message/FillValueOldMessage.java
  85. +7 −8 jhdf/src/main/java/io/jhdf/object/message/FilterPipelineMessage.java
  86. +5 −5 jhdf/src/main/java/io/jhdf/object/message/GroupInfoMessage.java
  87. +5 −5 jhdf/src/main/java/io/jhdf/object/message/LinkInfoMessage.java
  88. +7 −7 jhdf/src/main/java/io/jhdf/object/message/LinkMessage.java
  89. +7 −9 jhdf/src/main/java/io/jhdf/object/message/Message.java
  90. +2 −2 jhdf/src/main/java/io/jhdf/object/message/NilMessage.java
  91. +4 −4 jhdf/src/main/java/io/jhdf/object/message/ObjectCommentMessage.java
  92. +5 −5 jhdf/src/main/java/io/jhdf/object/message/ObjectHeaderContinuationMessage.java
  93. +5 −5 jhdf/src/main/java/io/jhdf/object/message/ObjectModificationTimeMessage.java
  94. +4 −4 jhdf/src/main/java/io/jhdf/object/message/ObjectReferenceCountMessage.java
  95. +5 −5 jhdf/src/main/java/io/jhdf/object/message/SymbolTableMessage.java
  96. +2 −2 jhdf/src/main/java/io/jhdf/object/message/package-info.java
  97. +16 −17 jhdf/src/test/java/io/jhdf/AttributesTest.java
  98. +14 −15 jhdf/src/test/java/io/jhdf/DatasetImplTest.java
  99. +11 −12 jhdf/src/test/java/io/jhdf/FractalHeapTest.java
  100. +14 −14 jhdf/src/test/java/io/jhdf/GlobalHeapTest.java
  101. +13 −13 jhdf/src/test/java/io/jhdf/GroupSymbolTableNodeTest.java
  102. +19 −20 jhdf/src/test/java/io/jhdf/GroupTest.java
  103. +20 −20 jhdf/src/test/java/io/jhdf/HdfFileChannelTest.java
  104. +26 −27 jhdf/src/test/java/io/jhdf/HdfFileTest.java
  105. +14 −15 jhdf/src/test/java/io/jhdf/LargeGroupTest.java
  106. +13 −13 jhdf/src/test/java/io/jhdf/LocalHeapTest.java
  107. +24 −25 jhdf/src/test/java/io/jhdf/ObjectHeaderTest.java
  108. +19 −20 jhdf/src/test/java/io/jhdf/ObjectHeaderV2Test.java
  109. +12 −13 jhdf/src/test/java/io/jhdf/OrderedGroupTest.java
  110. +18 −19 jhdf/src/test/java/io/jhdf/SuperblockTest.java
  111. +18 −19 jhdf/src/test/java/io/jhdf/SuperblockV3Test.java
  112. +12 −12 jhdf/src/test/java/io/jhdf/SymbolTableEntryTest.java
  113. +2 −2 jhdf/src/test/java/io/jhdf/TestUtils.java
  114. +9 −9 jhdf/src/test/java/io/jhdf/UserBlockTest.java
  115. +46 −46 jhdf/src/test/java/io/jhdf/UtilsTest.java
  116. +18 −19 jhdf/src/test/java/io/jhdf/btree/BTreeV1Test.java
  117. +7 −9 jhdf/src/test/java/io/jhdf/btree/record/LinkNameForIndexedGroupRecordTest.java
  118. +15 −16 jhdf/src/test/java/io/jhdf/dataset/ByteShuffleChunkedDatasetTest.java
  119. +15 −16 jhdf/src/test/java/io/jhdf/dataset/ChunkedDatasetTest.java
  120. +3 −5 jhdf/src/test/java/io/jhdf/dataset/CompoundDatasetTest.java
  121. +13 −14 jhdf/src/test/java/io/jhdf/dataset/CompressedChunkedDatasetTest.java
  122. +17 −17 jhdf/src/test/java/io/jhdf/dataset/DatasetByAddressTest.java
  123. +17 −18 jhdf/src/test/java/io/jhdf/dataset/DatasetReaderTest.java
  124. +15 −16 jhdf/src/test/java/io/jhdf/dataset/EmptyDatasetTest.java
  125. +14 −15 jhdf/src/test/java/io/jhdf/dataset/FillValueDatasetTest.java
  126. +3 −7 jhdf/src/test/java/io/jhdf/dataset/OddDatasetTest.java
  127. +15 −16 jhdf/src/test/java/io/jhdf/dataset/ScalarDatasetTest.java
  128. +17 −18 jhdf/src/test/java/io/jhdf/dataset/StringDatasetTest.java
  129. +5 −7 jhdf/src/test/java/io/jhdf/examples/PrintTreeTest.java
  130. +5 −5 jhdf/src/test/java/io/jhdf/examples/ReadAttributeTest.java
  131. +5 −5 jhdf/src/test/java/io/jhdf/examples/ReadDatasetTest.java
  132. +2 −2 jhdf/src/test/java/io/jhdf/examples/TestAllFiles.java
  133. +6 −6 jhdf/src/test/java/io/jhdf/exceptions/ExceptionsTest.java
  134. +4 −4 jhdf/src/test/java/io/jhdf/filter/MissingFilterTest.java
  135. +14 −15 jhdf/src/test/java/io/jhdf/links/LinksTest.java
  136. +15 −16 jhdf/src/test/java/io/jhdf/object/message/AttributeMessageV1Test.java
  137. +15 −16 jhdf/src/test/java/io/jhdf/object/message/AttributeMessageV3Test.java
  138. +7 −7 jhdf/src/test/java/io/jhdf/object/message/FillValueOldMessageTest.java
  139. +9 −10 jhdf/src/test/java/io/jhdf/object/message/ObjectCommentMessageTest.java
  140. +10 −11 jhdf/src/test/java/io/jhdf/object/message/ObjectModificationTimeMessageTest.java
  141. +0 −1 jhdf/src/test/resources/io/jhdf/make_test_files.py
  142. +0 −1 jhdf/src/test/resources/io/jhdf/scalar_empty_datasets.py
  143. +0 −1 jhdf/src/test/resources/io/jhdf/string_datasets.py
  144. +0 −2 jhdf/src/test/resources/io/jhdf/userblock.py
  145. +1 −1 jhdf/src/test/resources/io/jhdf/zenodo.py
@@ -1,9 +1,9 @@
/*******************************************************************************
/*
* This file is part of jHDF. A pure Java library for accessing HDF5 files.
*
* http://jhdf.io
*
* Copyright 2019 James Mudd
*
* MIT License see 'LICENSE' file
******************************************************************************/
*/
@@ -1,27 +1,14 @@
/*******************************************************************************
/*
* This file is part of jHDF. A pure Java library for accessing HDF5 files.
*
* http://jhdf.io
*
* Copyright 2019 James Mudd
*
* MIT License see 'LICENSE' file
******************************************************************************/
*/
package io.jhdf;

import static java.util.stream.Collectors.toMap;

import java.io.File;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.concurrent.ConcurrentException;
import org.apache.commons.lang3.concurrent.LazyInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.jhdf.api.Attribute;
import io.jhdf.api.Group;
import io.jhdf.api.Node;
@@ -32,6 +19,18 @@
import io.jhdf.object.message.AttributeInfoMessage;
import io.jhdf.object.message.AttributeMessage;
import io.jhdf.object.message.Message;
import org.apache.commons.lang3.concurrent.ConcurrentException;
import org.apache.commons.lang3.concurrent.LazyInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import static java.util.stream.Collectors.toMap;

public abstract class AbstractNode implements Node {
private static final Logger logger = LoggerFactory.getLogger(AbstractNode.class);
@@ -1,28 +1,27 @@
/*******************************************************************************
/*
* This file is part of jHDF. A pure Java library for accessing HDF5 files.
*
* http://jhdf.io
*
* Copyright 2019 James Mudd
*
* MIT License see 'LICENSE' file
******************************************************************************/
*/
package io.jhdf;

import static org.apache.commons.lang3.ClassUtils.primitiveToWrapper;

import java.nio.ByteBuffer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.jhdf.api.Attribute;
import io.jhdf.api.Node;
import io.jhdf.dataset.DatasetReader;
import io.jhdf.dataset.VariableLengthDatasetReader;
import io.jhdf.object.datatype.DataType;
import io.jhdf.object.datatype.VariableLength;
import io.jhdf.object.message.AttributeMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.nio.ByteBuffer;

import static org.apache.commons.lang3.ClassUtils.primitiveToWrapper;

public class AttributeImpl implements Attribute {
private static final Logger logger = LoggerFactory.getLogger(AttributeImpl.class);
@@ -1,12 +1,12 @@
/*******************************************************************************
/*
* This file is part of jHDF. A pure Java library for accessing HDF5 files.
*
* http://jhdf.io
*
* Copyright 2019 James Mudd
*
* MIT License see 'LICENSE' file
******************************************************************************/
*/
package io.jhdf;

public final class Constants {
@@ -1,21 +1,18 @@
/*******************************************************************************
/*
* This file is part of jHDF. A pure Java library for accessing HDF5 files.
*
* http://jhdf.io
*
* Copyright 2019 James Mudd
*
* MIT License see 'LICENSE' file
******************************************************************************/
*/
package io.jhdf;

import static io.jhdf.Constants.UNDEFINED_ADDRESS;
import static io.jhdf.Utils.bitsToInt;
import static io.jhdf.Utils.bytesNeededToHoldNumber;
import static io.jhdf.Utils.createSubBuffer;
import static io.jhdf.Utils.readBytesAsUnsignedInt;
import static io.jhdf.Utils.readBytesAsUnsignedLong;
import static java.nio.ByteOrder.LITTLE_ENDIAN;
import io.jhdf.exceptions.HdfException;
import io.jhdf.exceptions.UnsupportedHdfException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.math.BigInteger;
import java.nio.ByteBuffer;
@@ -27,11 +24,13 @@
import java.util.NavigableMap;
import java.util.TreeMap;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.jhdf.exceptions.HdfException;
import io.jhdf.exceptions.UnsupportedHdfException;
import static io.jhdf.Constants.UNDEFINED_ADDRESS;
import static io.jhdf.Utils.bitsToInt;
import static io.jhdf.Utils.bytesNeededToHoldNumber;
import static io.jhdf.Utils.createSubBuffer;
import static io.jhdf.Utils.readBytesAsUnsignedInt;
import static io.jhdf.Utils.readBytesAsUnsignedLong;
import static java.nio.ByteOrder.LITTLE_ENDIAN;

/**
* Fractal heap implementation. Used for storing data which can be looked up via
@@ -59,7 +58,6 @@

private final int maxDirectBlockSize;
private final long maxSizeOfManagedObjects;
private final long addressOfRootBlock;
private final int idLength;
private final int ioFiltersLength;
private final int currentRowsInRootIndirectBlock;
@@ -154,7 +152,7 @@ public FractalHeap(HdfFileChannel hdfFc, long address) {

startingRowsInRootIndirectBlock = readBytesAsUnsignedInt(bb, 2);

addressOfRootBlock = readBytesAsUnsignedLong(bb, sb.getSizeOfOffsets());
final long addressOfRootBlock = readBytesAsUnsignedLong(bb, sb.getSizeOfOffsets());

currentRowsInRootIndirectBlock = readBytesAsUnsignedInt(bb, 2);

@@ -233,7 +231,6 @@ public ByteBuffer getId(ByteBuffer buffer) {
private class IndirectBlock {

private final List<Long> childBlockAddresses;
private final long blockOffset;

private IndirectBlock(long address) {
final int headerSize = 4 + 1 + sb.getSizeOfOffsets() + bytesToStoreOffset
@@ -261,7 +258,7 @@ private IndirectBlock(long address) {
throw new HdfException("Indirect block read from invalid fractal heap");
}

blockOffset = readBytesAsUnsignedLong(bb, bytesToStoreOffset);
final long blockOffset = readBytesAsUnsignedLong(bb, bytesToStoreOffset);

childBlockAddresses = new ArrayList<>(currentRowsInRootIndirectBlock * tableWidth);
for (int i = 0; i < currentRowsInRootIndirectBlock * tableWidth; i++) {
@@ -1,24 +1,24 @@
/*******************************************************************************
/*
* This file is part of jHDF. A pure Java library for accessing HDF5 files.
*
* http://jhdf.io
*
* Copyright 2019 James Mudd
*
* MIT License see 'LICENSE' file
******************************************************************************/
*/
package io.jhdf;

import static io.jhdf.Utils.createSubBuffer;
import static io.jhdf.Utils.readBytesAsUnsignedInt;
import static io.jhdf.Utils.seekBufferToNextMultipleOfEight;
import io.jhdf.exceptions.HdfException;

import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

import io.jhdf.exceptions.HdfException;
import static io.jhdf.Utils.createSubBuffer;
import static io.jhdf.Utils.readBytesAsUnsignedInt;
import static io.jhdf.Utils.seekBufferToNextMultipleOfEight;

public class GlobalHeap {

@@ -1,26 +1,14 @@
/*******************************************************************************
/*
* This file is part of jHDF. A pure Java library for accessing HDF5 files.
*
* http://jhdf.io
*
* Copyright 2019 James Mudd
*
* MIT License see 'LICENSE' file
******************************************************************************/
*/
package io.jhdf;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.concurrent.ConcurrentException;
import org.apache.commons.lang3.concurrent.LazyInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.jhdf.api.Dataset;
import io.jhdf.api.Group;
import io.jhdf.api.Node;
@@ -38,6 +26,17 @@
import io.jhdf.object.message.LinkInfoMessage;
import io.jhdf.object.message.LinkMessage;
import io.jhdf.object.message.SymbolTableMessage;
import org.apache.commons.lang3.concurrent.ConcurrentException;
import org.apache.commons.lang3.concurrent.LazyInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class GroupImpl extends AbstractNode implements Group {
private final class ChildrenLazyInitializer extends LazyInitializer<Map<String, Node>> {
@@ -1,23 +1,22 @@
/*******************************************************************************
/*
* This file is part of jHDF. A pure Java library for accessing HDF5 files.
*
* http://jhdf.io
*
* Copyright 2019 James Mudd
*
* MIT License see 'LICENSE' file
******************************************************************************/
*/
package io.jhdf;

import static java.nio.ByteOrder.LITTLE_ENDIAN;
import io.jhdf.exceptions.HdfException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.nio.ByteBuffer;
import java.util.Arrays;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.jhdf.exceptions.HdfException;
import static java.nio.ByteOrder.LITTLE_ENDIAN;

public class GroupSymbolTableNode {
private static final Logger logger = LoggerFactory.getLogger(GroupSymbolTableNode.class);
@@ -1,14 +1,26 @@
/*******************************************************************************
/*
* This file is part of jHDF. A pure Java library for accessing HDF5 files.
*
* http://jhdf.io
*
* Copyright 2019 James Mudd
*
* MIT License see 'LICENSE' file
******************************************************************************/
*/
package io.jhdf;

import io.jhdf.Superblock.SuperblockV0V1;
import io.jhdf.Superblock.SuperblockV2V3;
import io.jhdf.api.Attribute;
import io.jhdf.api.Dataset;
import io.jhdf.api.Group;
import io.jhdf.api.Node;
import io.jhdf.api.NodeType;
import io.jhdf.exceptions.HdfException;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
@@ -19,19 +31,6 @@
import java.util.Map;
import java.util.Set;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.jhdf.Superblock.SuperblockV0V1;
import io.jhdf.Superblock.SuperblockV2V3;
import io.jhdf.api.Attribute;
import io.jhdf.api.Dataset;
import io.jhdf.api.Group;
import io.jhdf.api.Node;
import io.jhdf.api.NodeType;
import io.jhdf.exceptions.HdfException;

/**
* The HDF file class this object represents a HDF5 file on disk and provides
* methods to access it.
@@ -53,9 +52,7 @@
private final File file;
private final HdfFileChannel hdfFc;

private final Superblock superblock;

private final Group rootGroup;
private final Group rootGroup;

private final Set<HdfFile> openExternalFiles = new HashSet<>();

@@ -84,7 +81,7 @@ public HdfFile(File hdfFile) {
}

// We have a valid HDF5 file so read the full superblock
superblock = Superblock.readSuperblock(fc, offset);
final Superblock superblock = Superblock.readSuperblock(fc, offset);

// Validate the superblock
if (superblock.getBaseAddressByte() != offset) {

0 comments on commit c4cc39c

Please sign in to comment.
You can’t perform that action at this time.