Constructor and Description |
---|
HdfFile(java.io.File file) |
HdfFile(java.nio.file.Path hdfFile) |
HdfFile(java.net.URI uri) |
Modifier and Type | Method and Description |
---|---|
void |
addExternalFile(HdfFile hdfFile)
Add an external file to this HDF file.
|
void |
close() |
static HdfFile |
fromByteBuffer(java.nio.ByteBuffer byteBuffer)
Opens an HDF5 contained in
ByteBuffer |
static HdfFile |
fromBytes(byte[] bytes)
Opens an HDF5 contained in an in-memory byte array.
|
static HdfFile |
fromInputStream(java.io.InputStream inputStream)
Opens an
HdfFile from an InputStream . |
long |
getAddress()
This returns the byte offset into the file of the object header for this
node.
|
Attribute |
getAttribute(java.lang.String name)
Gets the attribute with the given name.
|
java.util.Map<java.lang.String,Attribute> |
getAttributes()
Gets the attributes associated with this
Node . |
Node |
getByPath(java.lang.String path)
Gets a
Node by path. |
Node |
getChild(java.lang.String name)
Gets a child of this group by name.
|
java.util.Map<java.lang.String,Node> |
getChildren()
Gets the children in this group, i.e other groups and datasets contained
inside this group.
|
Dataset |
getDatasetByPath(java.lang.String path)
Gets a
Dataset by path. |
java.io.File |
getFile()
Gets the
File object containing this Node .Call Node.getFileAsPath() instead if the file does not reside in the default file system. |
java.nio.file.Path |
getFileAsPath()
Gets the
Path object containing this Node . |
HdfBackingStorage |
getHdfBackingStorage() |
HdfFile |
getHdfFile()
Gets the parent
HdfFile of this node can be useful if you want to
resolve an absolute path in this file. |
java.lang.String |
getName()
Gets the name of this
Node |
Node |
getNodeByAddress(long address) |
Group |
getParent()
|
java.lang.String |
getPath()
Gets the absolute path within the file of this node including the nodes name.
|
NodeType |
getType()
Gets the type of this
Node . |
java.nio.ByteBuffer |
getUserBlockBuffer()
Gets the buffer containing the user block data.
|
long |
getUserBlockSize()
Gets the size of the user block of this file.
|
boolean |
inMemory() |
boolean |
isAttributeCreationOrderTracked()
If
true the insertion order of attributes is tracked (recorded)
in the file. |
boolean |
isGroup()
|
boolean |
isLink()
|
boolean |
isLinkCreationOrderTracked()
If
true the insertion order of links into this Group is
tracked (recorded) in the file. |
java.util.Iterator<Node> |
iterator() |
long |
size()
Returns the size of this HDF5 file.
|
java.lang.String |
toString() |
public HdfFile(java.io.File file)
public HdfFile(java.net.URI uri)
public HdfFile(java.nio.file.Path hdfFile)
public static HdfFile fromBytes(byte[] bytes)
bytes
- The byte array containing an HDF5 filefromByteBuffer(ByteBuffer)
,
fromInputStream(InputStream)
public static HdfFile fromByteBuffer(java.nio.ByteBuffer byteBuffer)
ByteBuffer
byteBuffer
- The buffer containing an HDF5 filefromBytes(byte[])
,
fromInputStream(InputStream)
public static HdfFile fromInputStream(java.io.InputStream inputStream)
HdfFile
from an InputStream
. The stream will be read fully into a temporary file. The
file will be cleaned up at application exit.inputStream
- the InputStream
to readfromBytes(byte[])
,
fromByteBuffer(ByteBuffer)
public long getUserBlockSize()
public java.nio.ByteBuffer getUserBlockBuffer()
public void close()
close
in interface java.lang.AutoCloseable
HdfException
- if closing the file failsRandomAccessFile.close()
public long size()
public boolean isGroup()
Node
public java.util.Map<java.lang.String,Node> getChildren()
Group
getChildren
in interface Group
Node
of this groups childrenpublic java.lang.String getName()
Node
Node
public java.lang.String getPath()
Node
public java.util.Map<java.lang.String,Attribute> getAttributes()
Node
Node
.getAttributes
in interface Node
public Attribute getAttribute(java.lang.String name)
Node
Node.getAttributes()
.get(name).getAttribute
in interface Node
name
- of the requested attributenull
if not availablepublic java.lang.String toString()
toString
in class java.lang.Object
public NodeType getType()
Node
Node
.public java.io.File getFile()
Node
File
object containing this Node
.Node.getFileAsPath()
instead if the file does not reside in the default file system.public java.nio.file.Path getFileAsPath()
Node
Path
object containing this Node
.getFileAsPath
in interface Node
public long getAddress()
Node
getAddress
in interface Node
public java.util.Iterator<Node> iterator()
iterator
in interface java.lang.Iterable<Node>
public Node getChild(java.lang.String name)
Group
Group.getChildren()
.get(name).public Node getByPath(java.lang.String path)
Group
Node
by path. The path given will be relative to this node.public Dataset getDatasetByPath(java.lang.String path)
Group
Dataset
by path. The path given will be relative to this node.getDatasetByPath
in interface Group
path
- the path to the requested datasetpublic HdfFile getHdfFile()
Node
HdfFile
of this node can be useful if you want to
resolve an absolute path in this file.getHdfFile
in interface Node
Node
public void addExternalFile(HdfFile hdfFile)
hdfFile
- an open external file linked from this filepublic boolean isLink()
Node
public boolean isAttributeCreationOrderTracked()
Node
true
the insertion order of attributes is tracked (recorded)
in the file.isAttributeCreationOrderTracked
in interface Node
true
if attribute creation order is tracked.public boolean isLinkCreationOrderTracked()
Group
true
the insertion order of links into this Group
is
tracked (recorded) in the file.isLinkCreationOrderTracked
in interface Group
true
if link creation order is tracked,
false
otherwisepublic HdfBackingStorage getHdfBackingStorage()
HdfBackingStorage
public boolean inMemory()
public Node getNodeByAddress(long address)