mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-01-20 09:17:29 +07:00
Added InvalidFormat
Added deprecated constructor for InvalidFormat with a null ByteInput for temp back compat
This commit is contained in:
parent
088cde3b9e
commit
d70668d11d
28
core/src/com/riiablo/io/InvalidFormat.java
Normal file
28
core/src/com/riiablo/io/InvalidFormat.java
Normal file
@ -0,0 +1,28 @@
|
||||
package com.riiablo.io;
|
||||
|
||||
public class InvalidFormat extends RuntimeException {
|
||||
public final long offset;
|
||||
|
||||
public InvalidFormat(ByteInput in, String message) {
|
||||
this(in, message, null);
|
||||
}
|
||||
|
||||
public InvalidFormat(ByteInput in, Throwable cause) {
|
||||
this(in, "Invalid format", cause);
|
||||
}
|
||||
|
||||
public InvalidFormat(ByteInput in, String message, Throwable cause) {
|
||||
super(message + " @0x" + Integer.toHexString(in.bytesRead()), cause);
|
||||
this.offset = in.bytesRead();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public InvalidFormat(String message) {
|
||||
super(message, null);
|
||||
this.offset = 0L;
|
||||
}
|
||||
|
||||
public long offset() {
|
||||
return offset;
|
||||
}
|
||||
}
|
@ -8,9 +8,9 @@ import com.badlogic.gdx.utils.Array;
|
||||
import com.riiablo.Riiablo;
|
||||
import com.riiablo.codec.excel.Gems;
|
||||
import com.riiablo.codec.util.BitStream;
|
||||
import com.riiablo.io.InvalidFormat;
|
||||
import com.riiablo.log.Log;
|
||||
import com.riiablo.log.LogManager;
|
||||
import com.riiablo.save.InvalidFormat;
|
||||
import com.riiablo.util.DebugUtils;
|
||||
|
||||
public class ItemSerializer {
|
||||
|
Loading…
Reference in New Issue
Block a user