Class CustomMessageReader


  • public class CustomMessageReader
    extends Object
    Trait to be implemented by custom message (unrelated to the channel/gossip LN layers) decoders.
    • Method Detail

      • destroy

        public void destroy()
        Destroys the object, freeing associated resources. After this call, any access to this object may result in a SEGFAULT or worse. You should generally NEVER call this method. You should let the garbage collector do this for you when it finalizes objects. However, it may be useful for types which represent locks and should be closed immediately to avoid holding locks until the GC runs.
      • read

        public Result_COption_TypeZDecodeErrorZ read​(short message_type,
                                                     byte[] buffer)
        Decodes a custom message to `CustomMessageType`. If the given message type is known to the implementation and the message could be decoded, must return `Ok(Some(message))`. If the message type is unknown to the implementation, must return `Ok(None)`. If a decoding error occur, must return `Err(DecodeError::X)` where `X` details the encountered error.