From f5ababed84ae731c88f37c7db73cd58176a81fd0 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Sat, 8 Aug 2020 11:45:37 -0700 Subject: [PATCH] Renamed discard methods to skip --- core/src/com/riiablo/io/nio/BitInput.java | 4 ++-- core/src/com/riiablo/io/nio/ByteInput.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/com/riiablo/io/nio/BitInput.java b/core/src/com/riiablo/io/nio/BitInput.java index 2278d73f..2c7346a8 100644 --- a/core/src/com/riiablo/io/nio/BitInput.java +++ b/core/src/com/riiablo/io/nio/BitInput.java @@ -138,14 +138,14 @@ public class BitInput { /** * Skips n 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 diff --git a/core/src/com/riiablo/io/nio/ByteInput.java b/core/src/com/riiablo/io/nio/ByteInput.java index 557f7c8f..7eb8972f 100644 --- a/core/src/com/riiablo/io/nio/ByteInput.java +++ b/core/src/com/riiablo/io/nio/ByteInput.java @@ -60,7 +60,7 @@ public class ByteInput { /** * Skips n 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 { *

* Precondition: {@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(