Graham
2b9f423e9a
Remove unused Iterable extensions
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
49e5781288
Add addAll and clear methods to UniqueQueue
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
81e665e9d8
Add UniqueQueue
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
1954f408e7
Replace deprecated capitalize() function
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
b37e4d0d0b
Use alternatives for most methods deprecated in Kotlin 1.5
...
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
30828308b2
Replace assertThrows with assertFailsWith
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
22c1b8a183
Use useTempFile extension method in atomicWrite
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
0b43e26d36
Remove redundant toList() calls after sorted()
...
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
192d5b9e8d
Resolve inspections
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
b2a7464da2
Use Kotlin's new ArrayDeque class
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
3f8e1a1951
Add FlatFileStoreTest
...
This commit fixes some bugs in FlatFileStore at the same time.
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
ada90fb027
Add DiskStore tests
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
cec68723a4
Add Cp1252Charset contains test
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
eef8fc1f0c
Improve Cp1252Charset.contains()
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
2525501901
Add ModifiedUtf8Charset
...
Will be used by the packclass implementation. Like Cp1252Charset, the
JDK isn't guaranteed to provide an implementation of this charset.
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
7ab3b3d335
Add method for calculating the K&R hash code of a CP-1252-encoded string
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
be7cc9ac8a
Add Cp1252Charset
...
Slightly different to the standard implementation, as like the client it
considers NUL to be an unmappable character. (Furthermore, the standard
implementation isn't in StandardCharsets.)
It also provides fast methods for encoding/decoding a single byte/char
at a time.
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
7179743f5d
Add fsync() extension method
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
c3715d7320
Add useTempFile extension methods
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
8370ad104e
Write files atomically
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
eef6d31753
Replace org.junit.jupiter.api.Test with kotlin.test.Test
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
ccf7056a93
Use private companion objects where possible
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
0206bbd4b2
Set DeterministicJarOutputStream's default compression level to 9
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
8685d2b2dc
Remove unused DeterministicJarOutputStream methods
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
10145fdb43
Add Sequence<JarEntry> extension property to JarInputStream
...
This improves the readability of code that iterates through all entries
in a jar.
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Scu11
26348b8a2e
Move Library#write methods to dedicated classes
...
Signed-off-by: Scu11 <scu11@openrs2.dev>
5 years ago
Graham
9a1c0e9caf
Add DeterministicJarOutputStreamTest
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
958fbc03ba
Add IterableUtilsTest
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
972d3cebc1
Add ForestDisjointSetTest
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
1c539f22fe
Add DisjointSet and ForestDisjointSet documentation
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
54aa9b738c
Add testFlush() to SkipOutputStreamTest
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
fced5610a5
Add SkipOutputStreamTest
5 years ago
Graham
09f17d246b
Add additional removeFirst() variants to IterableUtils
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
465078256f
Rename common module to util again
...
As I'm splitting it up into smaller modules (e.g. compress and crypto) I
think util is a more appropriate name for the remainder.
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
e05653cdcc
Rename util to common
5 years ago
Graham
b25f3c0c58
Convert ForestDisjointSet to Kotlin
5 years ago
Graham
7a0f94dbde
Convert elements and partitions to properties
5 years ago
Graham
c0836e11f6
Convert DisjointSet to Kotlin
5 years ago
Graham
429867e3af
Convert SkipOutputStream to Kotlin
...
This commit also changes the skipBytes logic slightly to avoid the need
to modify the off/len arguments, which is not possible in Kotlin.
5 years ago
Graham
caaa53095d
Convert DeterministicJarOutputStream to Kotlin
5 years ago
Graham
72db700534
Remove capitalize() method
...
Kotlin already has a capitalize() method - we don't need to define our
own.
5 years ago
Graham
db971f6b2b
Convert indefiniteArticle() to an extension method
5 years ago
Graham
09141e451a
Convert StringUtilsTest to Kotlin
5 years ago
Graham
879e3152fc
Convert StringUtils to Kotlin
5 years ago
Graham
1333cc31e6
Format StringUtilsTest
5 years ago
Graham
ef9e61de33
Add StringUtilsTest
5 years ago