mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-15 20:02:01 +01:00
Add throws IndexOutOfBoundsException
buffer warning
This commit is contained in:
parent
879942e6ab
commit
dd1b584cd2
@ -103,13 +103,13 @@ public sealed interface NetworkBuffer permits NetworkBufferImpl {
|
||||
return new NetworkBufferTypeImpl.LazyType<>(supplier);
|
||||
}
|
||||
|
||||
<T> void write(@NotNull Type<T> type, @UnknownNullability T value);
|
||||
<T> void write(@NotNull Type<T> type, @UnknownNullability T value) throws IndexOutOfBoundsException;
|
||||
|
||||
<T> @UnknownNullability T read(@NotNull Type<T> type);
|
||||
<T> @UnknownNullability T read(@NotNull Type<T> type) throws IndexOutOfBoundsException;
|
||||
|
||||
<T> void writeAt(long index, @NotNull Type<T> type, @UnknownNullability T value);
|
||||
<T> void writeAt(long index, @NotNull Type<T> type, @UnknownNullability T value) throws IndexOutOfBoundsException;
|
||||
|
||||
<T> @UnknownNullability T readAt(long index, @NotNull Type<T> type);
|
||||
<T> @UnknownNullability T readAt(long index, @NotNull Type<T> type) throws IndexOutOfBoundsException;
|
||||
|
||||
void copyTo(long srcOffset, byte @NotNull [] dest, long destOffset, long length);
|
||||
|
||||
|
@ -159,14 +159,14 @@ final class NetworkBufferImpl implements NetworkBuffer {
|
||||
|
||||
public long advanceWrite(long length) {
|
||||
final long oldWriteIndex = writeIndex;
|
||||
writeIndex += length;
|
||||
writeIndex = oldWriteIndex + length;
|
||||
return oldWriteIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long advanceRead(long length) {
|
||||
final long oldReadIndex = readIndex;
|
||||
readIndex += length;
|
||||
readIndex = oldReadIndex + length;
|
||||
return oldReadIndex;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user