collinsmith / riiablo

Diablo II remade using Java and LibGDX
http://riiablo.com
Apache License 2.0
869 stars 99 forks source link

Replace Guava LittleEndianDataStream with Apache Commons equivalent #130

Closed collinsmith closed 3 years ago

collinsmith commented 3 years ago

Guava is officially deprecated within this project since it hasn't been used in years and I don't see any point in using both Guava and Apache Commons. Additionally, removing it as a dependency should allow for slightly smaller dists. The only remaining vestiges are

com.google.common.io.LittleEndianDataInputStream
com.google.common.io.LittleEndianDataOutputStream

These usages should be replaced with Apache Commons equivalents or written using org.apache.commons.io.EndianUtils or maybe even ByteInput and ByteOutput.

collinsmith commented 3 years ago

Looked into using org.apache.commons.io.input.SwappedDataInputStream, however that does not support reading UTF characters or lines, so it is not suitable for com.riiablo.codec.excel.Excel. There was also not a corresponding implementation for SwappedDataOutputStream.

I think the best course of action would be to change the bin impls to use ByteInput and ByteOutput and remove the buffering of the input streams. This issue will require more research.


This issue may end up being lopped in with #26 and handled with the next excel iteration.

collinsmith commented 3 years ago

I opted to copy the required classes from Guava directly into my code base temporarily until the next excel iteration is complete.