MCPcopy Index your code
hub / github.com/Q16G/memory-shell / encode

Method encode

src/main/java/org/example/tlv.java:66–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64
65 // 编码请求包(带加密)
66 public byte[] encode() {
67 // 加密数据
68 byte[] encryptedData = xorProcess(data);
69
70 ByteBuffer buffer = ByteBuffer.allocate(MAGIC_PREFIX.length + 5 + length);
71 buffer.put(MAGIC_PREFIX);
72 buffer.put(type);
73 buffer.putInt(length);
74 if (encryptedData != null && length > 0) {
75 buffer.put(encryptedData);
76 }
77 return buffer.array();
78 }
79
80 // 解码请求包(带解密)
81 public static Request decode(byte[] rawData) {

Callers 3

mainMethod · 0.45
mainMethod · 0.45
processMethod · 0.45

Calls 1

xorProcessMethod · 0.80

Tested by

no test coverage detected