cleanup and reformat
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-09-05 00:06:35 +02:00
parent 14b54501fd
commit fd2970fa59
81 changed files with 1245 additions and 766 deletions

View File

@@ -10,33 +10,38 @@ import java.util.List;
public class SerializationUtil
{
private SerializationUtil() {
private SerializationUtil()
{
throw new IllegalStateException("Utility class");
}
public static <T> String serializeBase64(List<T> dataList) {
public static <T> String serializeBase64(List<T> dataList)
{
try (ByteArrayOutputStream bo = new ByteArrayOutputStream();
ObjectOutputStream so = new ObjectOutputStream(bo)) {
ObjectOutputStream so = new ObjectOutputStream(bo))
{
so.writeObject(dataList);
so.flush();
return Base64.getEncoder().encodeToString(bo.toByteArray());
}
catch (IOException e) {
} catch (IOException e)
{
throw new SerializationException("Error during serialization", e);
}
}
public static <T> LinkedList<T> deserializeBase64(String dataStr) {
public static <T> LinkedList<T> deserializeBase64(String dataStr)
{
byte[] b = Base64.getDecoder().decode(dataStr);
ByteArrayInputStream bi = new ByteArrayInputStream(b);
ObjectInputStream si;
try {
try
{
si = new ObjectInputStream(bi);
return LinkedList.class.cast(si.readObject());
}
catch (IOException | ClassNotFoundException e) {
} catch (IOException | ClassNotFoundException e)
{
throw new SerializationException("Error during deserialization", e);
}
}