mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-01-20 09:17:29 +07:00
Renamed discard methods to skip
This commit is contained in:
parent
f71d32bc51
commit
f5ababed84
@ -138,14 +138,14 @@ public class BitInput {
|
||||
/**
|
||||
* Skips <i>n</i> bits by discarding them.
|
||||
*/
|
||||
public BitInput discardBits(long bits) {
|
||||
public BitInput skipBits(long bits) {
|
||||
if (bits < 0) throw new IllegalArgumentException("bits(" + bits + ") < " + 0);
|
||||
if (bits == 0) return this;
|
||||
|
||||
final long startingBitsRead = bitsRead;
|
||||
final long bytes = bits / Byte.SIZE;
|
||||
assert bytes <= Integer.MAX_VALUE : "bytes(" + bytes + ") > Integer.MAX_VALUE";
|
||||
if (bytes > 0) align().discardBytes((int) bytes);
|
||||
if (bytes > 0) align().skipBytes((int) bytes);
|
||||
|
||||
final long overflowBits = (startingBitsRead + bits) - bitsRead;
|
||||
// checks single byte, multi-byte and expected max value
|
||||
|
@ -60,7 +60,7 @@ public class ByteInput {
|
||||
/**
|
||||
* Skips <i>n</i> bytes by discarding them.
|
||||
*/
|
||||
public ByteInput discardBytes(int bytes) {
|
||||
public ByteInput skipBytes(int bytes) {
|
||||
buffer.skipBytes(bytes);
|
||||
return this;
|
||||
}
|
||||
@ -72,9 +72,9 @@ public class ByteInput {
|
||||
* <p/>
|
||||
* <b>Precondition:</b> {@code signature.length == 2}.
|
||||
*
|
||||
* @see #discardBytes(int)
|
||||
* @see #skipBytes(int)
|
||||
*/
|
||||
public ByteInput discardUntil(byte[] signature) {
|
||||
public ByteInput skipUntil(byte[] signature) {
|
||||
assert aligned() : "not aligned";
|
||||
if (signature.length != 2) {
|
||||
throw new IllegalArgumentException(
|
||||
|
Loading…
Reference in New Issue
Block a user