-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
StreamEntry support Binary instead of String
Revert Add StreamEntryBinary Revert format
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
src/main/java/redis/clients/jedis/resps/StreamEntryBinary.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package redis.clients.jedis.resps; | ||
|
||
import redis.clients.jedis.StreamEntryID; | ||
|
||
import java.io.IOException; | ||
import java.io.Serializable; | ||
import java.util.Map; | ||
|
||
public class StreamEntryBinary implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private StreamEntryID id; | ||
private Map<byte[], byte[]> fields; | ||
|
||
public StreamEntryBinary(StreamEntryID id, Map<byte[], byte[]> fields) { | ||
this.id = id; | ||
this.fields = fields; | ||
} | ||
|
||
public StreamEntryID getID() { | ||
return id; | ||
} | ||
|
||
public Map<byte[], byte[]> getFields() { | ||
return fields; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return id + " " + fields; | ||
} | ||
|
||
private void writeObject(java.io.ObjectOutputStream out) throws IOException { | ||
out.writeUnshared(this.id); | ||
out.writeUnshared(this.fields); | ||
} | ||
|
||
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { | ||
this.id = (StreamEntryID) in.readUnshared(); | ||
this.fields = (Map<byte[], byte[]>) in.readUnshared(); | ||
} | ||
} |