feat: support hessian packer (#36)

This commit is contained in:
ReaJason
2025-02-20 22:28:34 +08:00
parent 3e40763724
commit 18aa8ed60d
22 changed files with 349 additions and 49 deletions
@@ -0,0 +1,28 @@
import com.caucho.hessian.io.AbstractHessianInput;
import com.caucho.hessian.io.Hessian2Input;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.Base64;
/**
* @author ReaJason
* @since 2025/2/20
*/
@WebServlet("/hessian2")
public class Hessian2ReadObjServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String data = req.getParameter("data");
byte[] base64 = Base64.getDecoder().decode(data);
ByteArrayInputStream bis = new ByteArrayInputStream(base64);
AbstractHessianInput in = new Hessian2Input(bis);
in.readObject();
}
}