mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-03-06 07:30:41 +07:00
Renamed discard methods to more explicit ByteInput#discardBytes and BitInput#discardBits
This commit is contained in:
parent
3e6e2c05ce
commit
1868a8c089
@ -115,14 +115,14 @@ public class BitInput implements Aligned, AlignedReader, UnalignedReader {
|
||||
return byteInput.bitInput = new BitInput(byteInput, bitsCached, cache, numBits);
|
||||
}
|
||||
|
||||
public BitInput discard(long bits) {
|
||||
public BitInput discardBits(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().discard((int) bytes);
|
||||
if (bytes > 0) align().discardBytes((int) bytes);
|
||||
|
||||
final long overflowBits = (startingBitsRead + bits) - bitsRead;
|
||||
// checks single byte, multi-byte and expected max value
|
||||
|
@ -49,7 +49,7 @@ public class ByteInput implements Aligned, AlignedReader {
|
||||
return bitInput;
|
||||
}
|
||||
|
||||
public ByteInput discard(int bytes) {
|
||||
public ByteInput discardBytes(int bytes) {
|
||||
buffer.skipBytes(bytes);
|
||||
return this;
|
||||
}
|
||||
@ -61,7 +61,7 @@ public class ByteInput implements Aligned, AlignedReader {
|
||||
* <p/>
|
||||
* <b>Precondition:</b> {@code signature.length == 2}.
|
||||
*
|
||||
* @see #discard(int)
|
||||
* @see #discardBytes(int)
|
||||
*/
|
||||
public ByteInput discardUntil(byte[] signature) {
|
||||
assert aligned() : "not aligned";
|
||||
|
Loading…
Reference in New Issue
Block a user