Class NodeUtil
- java.lang.Object
-
- com.github.basking2.sdsai.dsds.node.NodeUtil
-
public class NodeUtil extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description NodeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <USERKEY,STOREKEY>
Node<USERKEY,STOREKEY>readNode(java.io.InputStream in, java.util.function.Function<byte[],USERKEY> loadUserKey, java.util.function.Function<byte[],STOREKEY> loadStoreKey)Load a node from an input stream.static <USERKEY,STOREKEY>
voidstoreNode(java.io.OutputStream out, Node<USERKEY,STOREKEY> node, java.util.function.Function<USERKEY,byte[]> storeUserKey, java.util.function.Function<STOREKEY,byte[]> storeStoreKey)
-
-
-
Method Detail
-
storeNode
public static <USERKEY,STOREKEY> void storeNode(java.io.OutputStream out, Node<USERKEY,STOREKEY> node, java.util.function.Function<USERKEY,byte[]> storeUserKey, java.util.function.Function<STOREKEY,byte[]> storeStoreKey) throws java.io.IOException- Throws:
java.io.IOException
-
readNode
public static <USERKEY,STOREKEY> Node<USERKEY,STOREKEY> readNode(java.io.InputStream in, java.util.function.Function<byte[],USERKEY> loadUserKey, java.util.function.Function<byte[],STOREKEY> loadStoreKey) throws java.io.IOException
Load a node from an input stream.- Type Parameters:
USERKEY- The type of the user key.STOREKEY- The type of the storage key.- Parameters:
in- The input stream to read from.loadUserKey- How to convert bytes to a key for the user.loadStoreKey- How to convert bytes to a key that the storage system uses.- Returns:
- The unmarshalled node.
- Throws:
java.io.IOException- On any error.
-
-