From d5e2f6350b5a34b55f385afe3b88aff5b4bb3e6b Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 20 Jan 2026 18:48:54 +0000 Subject: [PATCH 1/2] Xor8: remove previous serialization methods --- .../main/java/org/fastfilter/xor/Xor8.java | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/fastfilter/src/main/java/org/fastfilter/xor/Xor8.java b/fastfilter/src/main/java/org/fastfilter/xor/Xor8.java index a54b0d9..6faa557 100644 --- a/fastfilter/src/main/java/org/fastfilter/xor/Xor8.java +++ b/fastfilter/src/main/java/org/fastfilter/xor/Xor8.java @@ -1,6 +1,5 @@ package org.fastfilter.xor; -import java.io.*; import java.nio.ByteBuffer; import org.fastfilter.Filter; @@ -164,34 +163,6 @@ private int fingerprint(long hash) { return (int) (hash & ((1 << BITS_PER_FINGERPRINT) - 1)); } - public byte[] getData() { - try { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - DataOutputStream d = new DataOutputStream(out); - d.writeInt(size); - d.writeLong(seed); - d.write(fingerprints); - return out.toByteArray(); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public Xor8(InputStream in) { - try { - DataInputStream din = new DataInputStream(in); - size = din.readInt(); - arrayLength = getArrayLength(size); - bitCount = arrayLength * BITS_PER_FINGERPRINT; - blockLength = arrayLength / HASHES; - seed = din.readLong(); - fingerprints = new byte[arrayLength]; - din.readFully(fingerprints); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - private Xor8(int size, long seed, byte[] fingerprints) { this.size = size; this.arrayLength = getArrayLength(size); From 9e19bc61cabfe1cd2b15af27aec943f15b3a4428 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 20 Jan 2026 19:06:05 +0000 Subject: [PATCH 2/2] Xor8: make methods deprecated --- .../main/java/org/fastfilter/xor/Xor8.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/fastfilter/src/main/java/org/fastfilter/xor/Xor8.java b/fastfilter/src/main/java/org/fastfilter/xor/Xor8.java index 6faa557..142fb87 100644 --- a/fastfilter/src/main/java/org/fastfilter/xor/Xor8.java +++ b/fastfilter/src/main/java/org/fastfilter/xor/Xor8.java @@ -1,5 +1,6 @@ package org.fastfilter.xor; +import java.io.*; import java.nio.ByteBuffer; import org.fastfilter.Filter; @@ -163,6 +164,36 @@ private int fingerprint(long hash) { return (int) (hash & ((1 << BITS_PER_FINGERPRINT) - 1)); } + @Deprecated + public byte[] getData() { + try { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + DataOutputStream d = new DataOutputStream(out); + d.writeInt(size); + d.writeLong(seed); + d.write(fingerprints); + return out.toByteArray(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Deprecated + public Xor8(InputStream in) { + try { + DataInputStream din = new DataInputStream(in); + size = din.readInt(); + arrayLength = getArrayLength(size); + bitCount = arrayLength * BITS_PER_FINGERPRINT; + blockLength = arrayLength / HASHES; + seed = din.readLong(); + fingerprints = new byte[arrayLength]; + din.readFully(fingerprints); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + private Xor8(int size, long seed, byte[] fingerprints) { this.size = size; this.arrayLength = getArrayLength(size);