public static CheckpointStorageLocationReference encodePathAsReference ( Path path ) { byte [ ] refBytes = path . toString ( ) . getBytes ( StandardCharsets . UTF_8 ) ; byte [ ] bytes = new byte [ REFERENCE_MAGIC_NUMBER . length + refBytes . length ] ; System . arraycopy ( REFERENCE_MAGIC_NUMBER , 0 , bytes , 0 , REFERENCE_MAGIC_NUMBER . length ) ; System . arraycopy ( refBytes , 0 , bytes , REFERENCE_MAGIC_NUMBER . length , refBytes . length ) ; return new CheckpointStorageLocationReference ( bytes ) ; }
Encodes the given path as a reference in bytes . The path is encoded as a UTF - 8 string and prepended as a magic number .