Formatting
This commit is contained in:
@@ -57,8 +57,10 @@ public interface RandomAccessData {
|
||||
* @param length the number of bytes to be read
|
||||
* @return the data
|
||||
* @throws IOException if the data cannot be read
|
||||
* @throws IndexOutOfBoundsException if offset is beyond the end of the file or subsection
|
||||
* @throws EOFException if offset plus length is greater than the length of the file or subsection
|
||||
* @throws IndexOutOfBoundsException if offset is beyond the end of the file or
|
||||
* subsection
|
||||
* @throws EOFException if offset plus length is greater than the length of the file
|
||||
* or subsection
|
||||
*/
|
||||
byte[] read(long offset, long length) throws IOException;
|
||||
|
||||
|
||||
@@ -110,20 +110,23 @@ public class RandomAccessDataFileTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void readWhenOffsetIsBeyondEndOfSubsectionShouldThrowException() throws Exception {
|
||||
public void readWhenOffsetIsBeyondEndOfSubsectionShouldThrowException()
|
||||
throws Exception {
|
||||
this.thrown.expect(IndexOutOfBoundsException.class);
|
||||
RandomAccessData subsection = this.file.getSubsection(0, 10);
|
||||
subsection.read(11, 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void readWhenOffsetPlusLengthGreaterThanEOFShouldThrowException() throws Exception {
|
||||
public void readWhenOffsetPlusLengthGreaterThanEOFShouldThrowException()
|
||||
throws Exception {
|
||||
this.thrown.expect(EOFException.class);
|
||||
this.file.read(256, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void readWhenOffsetPlusLengthGreaterThanEndOfSubsectionShouldThrowException() throws Exception {
|
||||
public void readWhenOffsetPlusLengthGreaterThanEndOfSubsectionShouldThrowException()
|
||||
throws Exception {
|
||||
this.thrown.expect(EOFException.class);
|
||||
RandomAccessData subsection = this.file.getSubsection(0, 10);
|
||||
subsection.read(10, 1);
|
||||
|
||||
@@ -199,4 +199,5 @@ public class AsciiBytesTests {
|
||||
private void matchesSameAsString(String input) {
|
||||
assertThat(new AsciiBytes(input).matches(input, NO_SUFFIX)).isTrue();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user