Polish "Override available() in RandomAccessDataFile's InputStream"
See gh-29295
This commit is contained in:
parent
49bf620f4b
commit
4f724f14d3
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -199,6 +199,15 @@ class RandomAccessDataFileTests {
|
|||
assertThat(amountSkipped).isEqualTo(0L);
|
||||
}
|
||||
|
||||
@Test
|
||||
void inputStreamAvailable() throws Exception {
|
||||
assertThat(this.inputStream.available()).isEqualTo(256);
|
||||
this.inputStream.skip(56);
|
||||
assertThat(this.inputStream.available()).isEqualTo(200);
|
||||
this.inputStream.skip(200);
|
||||
assertThat(this.inputStream.available()).isEqualTo(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
void subsectionNegativeOffset() {
|
||||
assertThatExceptionOfType(IndexOutOfBoundsException.class).isThrownBy(() -> this.file.getSubsection(-1, 1));
|
||||
|
|
|
|||
Loading…
Reference in New Issue