Commit f377551c authored by Ole Streicher's avatar Ole Streicher

Throw an IOException on reset() in (Multi)MappedFile

This is according to the mark/reset contract if this operation is unsupported.
parent 6da5b691
......@@ -3,13 +3,13 @@ Date: Mon, 20 Feb 2017 13:28:16 +0100
Subject: Use latest nom.tam.fits API
---
src/main/uk/ac/starlink/fits/AbstractArrayDataIO.java | 4 ++++
src/main/uk/ac/starlink/fits/FitsConstants.java | 6 +++---
src/main/uk/ac/starlink/fits/FitsTableBuilder.java | 4 ++--
src/main/uk/ac/starlink/fits/MappedFile.java | 18 +++++++++++++++++-
src/main/uk/ac/starlink/fits/MultiMappedFile.java | 16 ++++++++++++++++
.../uk/ac/starlink/fits/WritableFitsArrayImpl.java | 2 +-
6 files changed, 43 insertions(+), 7 deletions(-)
src/main/uk/ac/starlink/fits/AbstractArrayDataIO.java | 4 ++++
src/main/uk/ac/starlink/fits/FitsConstants.java | 6 +++---
src/main/uk/ac/starlink/fits/FitsTableBuilder.java | 4 ++--
src/main/uk/ac/starlink/fits/MappedFile.java | 19 ++++++++++++++++++-
src/main/uk/ac/starlink/fits/MultiMappedFile.java | 17 +++++++++++++++++
.../uk/ac/starlink/fits/WritableFitsArrayImpl.java | 2 +-
6 files changed, 45 insertions(+), 7 deletions(-)
diff --git a/src/main/uk/ac/starlink/fits/AbstractArrayDataIO.java b/src/main/uk/ac/starlink/fits/AbstractArrayDataIO.java
index 24065f6..8b81173 100644
......@@ -80,7 +80,7 @@ index 121d4d0..0bca02a 100644
}
diff --git a/src/main/uk/ac/starlink/fits/MappedFile.java b/src/main/uk/ac/starlink/fits/MappedFile.java
index 3116315..4fe84e7 100644
index 3116315..082bc39 100644
--- a/src/main/uk/ac/starlink/fits/MappedFile.java
+++ b/src/main/uk/ac/starlink/fits/MappedFile.java
@@ -106,11 +106,19 @@ public class MappedFile extends AbstractArrayDataIO implements RandomAccess {
......@@ -104,12 +104,13 @@ index 3116315..4fe84e7 100644
}
protected byte get() throws IOException {
@@ -169,6 +177,14 @@ public class MappedFile extends AbstractArrayDataIO implements RandomAccess {
@@ -169,6 +177,15 @@ public class MappedFile extends AbstractArrayDataIO implements RandomAccess {
}
}
+ public void reset() {
+ // no action
+ public void reset() throws IOException {
+ throw new IOException( "mark/reset not supported" );
+
+ }
+
+ public void mark( int i ) {
......@@ -120,7 +121,7 @@ index 3116315..4fe84e7 100644
* Returns a mapped byte buffer which results from mapping a given file.
*
diff --git a/src/main/uk/ac/starlink/fits/MultiMappedFile.java b/src/main/uk/ac/starlink/fits/MultiMappedFile.java
index 6d9a3cd..22c0689 100644
index 6d9a3cd..a165d48 100644
--- a/src/main/uk/ac/starlink/fits/MultiMappedFile.java
+++ b/src/main/uk/ac/starlink/fits/MultiMappedFile.java
@@ -101,6 +101,14 @@ public class MultiMappedFile extends AbstractArrayDataIO
......@@ -138,12 +139,13 @@ index 6d9a3cd..22c0689 100644
public int skipBytes( int toSkip ) throws IOException {
return toInt( skip( (long) toSkip ) );
};
@@ -193,6 +201,14 @@ public class MultiMappedFile extends AbstractArrayDataIO
@@ -193,6 +201,15 @@ public class MultiMappedFile extends AbstractArrayDataIO
}
}
+ public void reset() {
+ // no action
+ public void reset() throws IOException {
+ throw new IOException( "mark/reset not supported" );
+
+ }
+
+ public void mark( int i ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment