Graham
e4b617d712
Fix multiple @Inject constructors in ByteBufBodyHandler
...
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
2cc4b34ab3
Replace MutableList with List in ByteBufBodyHandler
...
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
1101f6e885
Add ByteBufBodyHandler
...
Allows a response from HttpClient to be efficiently read into a ByteBuf.
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
6f13a0a737
Add readVarInt and writeVarInt extension methods
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
29fecec34e
Add support for overriding the charset in readString/writeString
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
ea725b3881
Add extension methods for reading/writing null-terminated Cp1252 strings
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
ee151aef56
Add constants to BitBuf
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
bd5a925f9b
Add BitBuf
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
d7e9f83953
Return ByteBuf from extension methods for chaining
...
This is consistent with the built-in ByteBuf methods that would
otherwise return void/unit.
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
9bb511369d
Add automatically-generated ByteBuf extensions
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
6498d39306
Add Gradle 7 version catalog
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
359891c01e
Convert all test objects to classes
...
This is required for IDEA to display the run test icon in the gutter.
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
c295ecb0a0
Allow nullable ReferenceCounted objects to be passed to use
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
f099972bee
Make the nioBufferCount() > 1 case in crc32 more concise
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
f2f3da3281
Simplify testCrc32 slightly
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
07603d3cfa
Avoid copying the byte array in crc32() if possible
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
30828308b2
Replace assertThrows with assertFailsWith
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
76977303b2
Add shorthand methods for creating ByteBufs from ByteArrays and Strings
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
f143eef142
Move Kotlin files from src/{main,test}/java to src/{main,test}/kotlin
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
ce5b76ef0f
Rename dev.openrs2 package to org.openrs2
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
2482e20063
Add BufferModule for injecting ByteBufAllocator
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
5a20b75f4f
Use Preconditions.checkPositionIndexes() in ByteBuf.crc32()
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
a4234d066d
Add CRC-32 extension method to the ByteBuf class
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
ec4f8b59c9
Use default ByteBufAllocator in unit tests
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
bd010668dd
Add method chaining to ByteBufExtensions
...
This is required for the signature of writeUnsignedIntSmart to be the
same as writeShort, which the Js5Index encoder will make use of.
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
6314f3625a
Add ByteBuf extension methods for reading/writing smarts
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
232ba32bbd
Enable explicit API mode
...
This already caught some cases of public members that should have been
private and one case where the inferred type was too specific.
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
e0708458f9
Add use extension method for releasing reference-counted objects
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago