Renamed discard methods to skip

This commit is contained in:
Collin Smith 2020-08-08 11:45:37 -07:00
parent f71d32bc51
commit f5ababed84
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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(