diff options
author | gjoranv <gv@oath.com> | 2018-06-29 01:29:46 +0200 |
---|---|---|
committer | gjoranv <gv@oath.com> | 2018-06-29 17:20:32 +0200 |
commit | ba5cc41ae37324f57991648935c06fc9e6af5e94 (patch) | |
tree | a01259e5aee2d81b4441c245c888d61cf06f4551 /vespajlib/src | |
parent | eace6c1fea47df407977732da2d9f5312c5d9239 (diff) |
Java 10: Override new method Reader.transferTo
* Commented, as it doesn't compile with JDK <10
+ fix imports
Diffstat (limited to 'vespajlib/src')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/io/reader/NamedReader.java | 24 | ||||
-rw-r--r-- | vespajlib/src/test/java/com/yahoo/io/reader/NamedReaderTestCase.java | 3 |
2 files changed, 17 insertions, 10 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/io/reader/NamedReader.java b/vespajlib/src/main/java/com/yahoo/io/reader/NamedReader.java index 76346f8b1f6..0a437e93f41 100644 --- a/vespajlib/src/main/java/com/yahoo/io/reader/NamedReader.java +++ b/vespajlib/src/main/java/com/yahoo/io/reader/NamedReader.java @@ -5,6 +5,8 @@ import com.google.common.annotations.Beta; import java.io.IOException; import java.io.Reader; +import java.io.Writer; +import java.nio.CharBuffer; import java.util.List; /** @@ -35,25 +37,29 @@ public class NamedReader extends Reader { // The rest is reader method implementations which delegates to the wrapped reader @Override - public int read(java.nio.CharBuffer charBuffer) throws java.io.IOException { return reader.read(charBuffer); } + public int read(CharBuffer charBuffer) throws IOException { return reader.read(charBuffer); } @Override - public int read() throws java.io.IOException { return reader.read(); } + public int read() throws IOException { return reader.read(); } @Override - public int read(char[] chars) throws java.io.IOException { return reader.read(chars); } + public int read(char[] chars) throws IOException { return reader.read(chars); } @Override - public int read(char[] chars, int i, int i1) throws java.io.IOException { return reader.read(chars,i,i1); } + public int read(char[] chars, int i, int i1) throws IOException { return reader.read(chars,i,i1); } @Override - public long skip(long l) throws java.io.IOException { return reader.skip(l); } + public long skip(long l) throws IOException { return reader.skip(l); } @Override - public boolean ready() throws java.io.IOException { return reader.ready(); } + public boolean ready() throws IOException { return reader.ready(); } @Override public boolean markSupported() { return reader.markSupported(); } @Override - public void mark(int i) throws java.io.IOException { reader.mark(i); } + public void mark(int i) throws IOException { reader.mark(i); } @Override - public void reset() throws java.io.IOException { reader.reset(); } + public void reset() throws IOException { reader.reset(); } @Override - public void close() throws java.io.IOException { reader.close(); } + public void close() throws IOException { reader.close(); } + + // TODO Java 10: uncomment +// @Override +// public long transferTo(Writer out) throws IOException { return reader.transferTo(out); } /** Convenience method for closing a list of readers. Does nothing if the given reader list is null. */ public static void closeAll(List<NamedReader> readers) { diff --git a/vespajlib/src/test/java/com/yahoo/io/reader/NamedReaderTestCase.java b/vespajlib/src/test/java/com/yahoo/io/reader/NamedReaderTestCase.java index fcbc855bf74..3bbbf3ea7de 100644 --- a/vespajlib/src/test/java/com/yahoo/io/reader/NamedReaderTestCase.java +++ b/vespajlib/src/test/java/com/yahoo/io/reader/NamedReaderTestCase.java @@ -4,10 +4,11 @@ package com.yahoo.io.reader; import java.io.IOException; import java.io.Reader; import java.io.StringReader; +import java.lang.reflect.Method; import java.nio.CharBuffer; import java.util.Collections; +import java.util.List; -import com.yahoo.io.reader.NamedReader; import com.yahoo.protect.ClassValidator; import org.junit.Test; |