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

Method encode

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

Source from the content-addressed store, hash-verified

124
125 // 编码响应包(带加密)
126 public byte[] encode() {
127 // 加密数据
128 byte[] encryptedData = xorProcess(data);
129
130 ByteBuffer buffer = ByteBuffer.allocate(MAGIC_PREFIX.length + 5 + length);
131 buffer.put(MAGIC_PREFIX);
132 buffer.put(type);
133 buffer.putInt(length);
134 buffer.put(status);
135 if (encryptedData != null && encryptedData.length > 0) {
136 buffer.put(encryptedData);
137 }
138 return buffer.array();
139 }
140
141 // 解码响应包(带解密)
142 public static Response decode(byte[] rawData) {

Callers

nothing calls this directly

Calls 1

xorProcessMethod · 0.80

Tested by

no test coverage detected