1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package org.waarp.compress.zstdunsafe;
35
36
37 import java.util.Arrays;
38
39 class FrameHeader {
40 final long headerSize;
41 final int windowSize;
42 final long contentSize;
43 final long dictionaryId;
44 final boolean hasChecksum;
45
46 public FrameHeader(final long headerSize, final int windowSize,
47 final long contentSize, final long dictionaryId,
48 final boolean hasChecksum) {
49 this.headerSize = headerSize;
50 this.windowSize = windowSize;
51 this.contentSize = contentSize;
52 this.dictionaryId = dictionaryId;
53 this.hasChecksum = hasChecksum;
54 }
55
56 @Override
57 public boolean equals(final Object o) {
58 if (this == o) {
59 return true;
60 }
61 if (o == null || getClass() != o.getClass()) {
62 return false;
63 }
64 final FrameHeader that = (FrameHeader) o;
65 return headerSize == that.headerSize && windowSize == that.windowSize &&
66 contentSize == that.contentSize &&
67 dictionaryId == that.dictionaryId && hasChecksum == that.hasChecksum;
68 }
69
70 @Override
71 public int hashCode() {
72 return Arrays.hashCode(new Object[] {
73 headerSize, windowSize, contentSize, dictionaryId, hasChecksum
74 });
75 }
76
77 @Override
78 public String toString() {
79 return FrameHeader.class.getSimpleName() + "[headerSize=" + headerSize +
80 ", windowSize=" + windowSize + ", contentSize=" + contentSize +
81 ", dictionaryId=" + dictionaryId + ", hasChecksum=" + hasChecksum +
82 "]";
83 }
84 }