Commit Graph

1174 Commits

Author SHA1 Message Date
Collin Smith
8941ceee6e Implemented BitOutput#skipBits(long) and ByteOutput#skipBytes(int) 2020-08-10 18:34:54 -07:00
Collin Smith
984a0864ea Implemented writeString(CharSequence,int) 2020-08-10 18:34:12 -07:00
Collin Smith
2433fac1fe Implemented writeBoolean(boolean) and write1(int) methods to write a single bit 2020-08-10 18:33:40 -07:00
Collin Smith
4a00f0207f Relaxed requirements to allow writing 0 bits (a no-op) 2020-08-10 18:32:57 -07:00
Collin Smith
043e032ec5 Added getter for ByteInput ByteBuf for testing 2020-08-10 18:32:13 -07:00
Collin Smith
43b2eda1c6 Added method chaining support 2020-08-10 17:35:22 -07:00
Collin Smith
74d980319a Cleaned up flush and align methods
flush write cache and then erases it
align performs a flush and returns ByteOutput view
Reduced visibility of writeSigned and writeUnsigned
Implemented write signed methods
Implemented writeRaw method
Added getters for bitsCached and cache fields with package visibility
2020-08-10 01:49:36 -07:00
Collin Smith
66840f94d7 Refactored _writeUnsigned with _writeRaw with unsigned bit limits 2020-08-09 23:11:48 -07:00
Collin Smith
f901989e14 Implemented _writeRaw(long,int) 2020-08-09 23:05:38 -07:00
Collin Smith
11555397e3 Created ByteOutput and BitOutput 2020-08-09 20:06:06 -07:00
Collin Smith
4e2cd665cd Made bitsToAdd final 2020-08-09 20:05:44 -07:00
Collin Smith
f62c038ffe Added BYTE_MASK const (0xFF) 2020-08-09 20:05:31 -07:00
Collin Smith
97ebbb1dbb Additional assertion to validate invariants 2020-08-09 12:51:02 -07:00
Collin Smith
1b51043d7d Moved UBITS consts to BitConstants 2020-08-09 12:48:33 -07:00
Collin Smith
a9d33c2de8 Pulled unsigned masks out to BitConstants class 2020-08-08 23:06:36 -07:00
Collin Smith
c2ce0a3179 Added string reason for shift assertion failure 2020-08-08 17:53:50 -07:00
Collin Smith
7ed92b1f49 Replaced com.riiablo.io classes with com.riiablo.io.nio classes 2020-08-08 14:49:23 -07:00
Collin Smith
c8b74fccbf Commented out comments -- linter was thinking this class was deprecated 2020-08-08 14:46:32 -07:00
Collin Smith
acdbace5ea Deprecated and removed multi-byte read methods from BitInput
Unaligned multi-byte read operations shouldn't align stream
Implementing unaligned multi-byte read support is required
2020-08-08 14:40:11 -07:00
Collin Smith
7006ce9dc0 Added ByteBuf read-only invariant 2020-08-08 14:29:33 -07:00
Collin Smith
683d592c55 Created placeholder documentation to document relationship between input classes 2020-08-08 14:26:25 -07:00
Collin Smith
83ead2a990 Reduced #bitInput() method visibility -- unalign should be used instead outside of package 2020-08-08 14:24:47 -07:00
Collin Smith
f7a38d5e15 Documented ByteInput#bitInput(BitInput) invariants 2020-08-08 14:18:33 -07:00
Collin Smith
75ac29d698 Created bitInput() accessor to manage BitInput initialization and access 2020-08-08 14:15:51 -07:00
Collin Smith
20ae623fe7 Tightened up field visibility
Tightened up field visibility
ByteInput#bitInput set via bitInput(BitInput) which enforces invariants
2020-08-08 14:08:26 -07:00
Collin Smith
afd7bafa12 Fixed skipBits multi-byte using unaligned bit stream 2020-08-08 13:17:59 -07:00
Collin Smith
e62d3ec383 ByteInput#skipBytes now increments bitsRead 2020-08-08 12:04:51 -07:00
Collin Smith
99f0c11064 Created static factory method for constructing a BitInput from a byte array 2020-08-08 11:50:59 -07:00
Collin Smith
a244fbd09d Changed access to private 2020-08-08 11:48:01 -07:00
Collin Smith
f5ababed84 Renamed discard methods to skip 2020-08-08 11:45:37 -07:00
Collin Smith
f71d32bc51 Removed interfaces and added documentation to BitInput and ByteInput directly 2020-08-08 11:44:26 -07:00
Collin Smith
3e31869417 Fixed NPE caused by lazily initializing BitInput 2020-08-08 10:51:50 -07:00
Collin Smith
1868a8c089 Renamed discard methods to more explicit ByteInput#discardBytes and BitInput#discardBits 2020-08-08 03:49:36 -07:00
Collin Smith
3e6e2c05ce Changed ByteInput to lazily allocate BitInput object
BitInput not always required, mostly only ByteInput is used
Removed specialized BitInput constructors from ByteInput
ByteInput#unalign will allocate a BitInput of readableBytes size
BitInput#readSlice will allocate a BitInput of specified size
2020-08-08 03:47:36 -07:00
Collin Smith
673b437c61 Committing com.riiablo.io.nio experiment
Replaces com.riiablo.io if I decide to go this route
2020-08-08 01:07:28 -07:00
Collin Smith
dd1444ad9a Created com.riiablo.io with BitInput
Version 1 without full functionality
2020-08-07 12:17:54 -07:00
Collin Smith
cfb2850d92 Created more robust BitStream implementation
Pending validation, will deprecate and replace com.riiablo.codec.util.BitStream
2020-08-05 19:57:54 -07:00
Collin Smith
84748c56a3 Implemented skipUntil function to allow recovery attempts
skipUntil will align the bit stream to next byte and search for a 2 byte signature
2020-08-03 20:21:46 -07:00
Collin Smith
294f74dde3 Added warnf without Throwable arg 2020-08-03 20:17:28 -07:00
Collin Smith
65a8dee1eb Removed readU8 and replaced with equivalent appropriate substitutions 2020-08-03 16:29:21 -07:00
Collin Smith
0050720249 Implemented some use-cases for readRaw
Implemented some use-cases for readRaw and readU63
Replaced some Java primitive size consts with actual bit sizes according to d2 spec
2020-08-03 16:22:28 -07:00
Collin Smith
a0a46dc481 Changed DCC outsizeCoded from int to long to ensure it can hold a u32 2020-08-03 16:20:32 -07:00
Collin Smith
af480bdfc3 Created readRaw(int) and added support for correctly reading signed 64 bits 2020-08-03 16:12:52 -07:00
Collin Smith
d1ee547530 Created BitStream#readU63(int) 2020-08-03 16:11:59 -07:00
Collin Smith
55d1f18463 Renamed readUnsigned8OrLess to readU8 2020-08-03 16:06:05 -07:00
Collin Smith
8c9d51ee03 Renamed readUnsigned31OrLess to readU31 2020-08-03 16:04:46 -07:00
Collin Smith
10f8945ddb Renamed readUnsigned15OrLess to readU15 2020-08-03 16:03:45 -07:00
Collin Smith
70200c5521 Renamed readUnsigned7OrLess to readU7 2020-08-03 16:02:56 -07:00
Collin Smith
a8e2402a19 Disabled skipping of item byte stream signature
ItemSerializer will process and validate item signature
Implemented far more robust logging to ItemSerializer
2020-08-02 11:11:59 -07:00
Collin Smith
e8f359ffa2 Changed return type of readSigned from sign extended int to long 2020-07-28 04:59:49 -07:00