8136738: InputStream documentation for IOException in skip() is unclear or incorrect

Clarify javadoc of skip().

Reviewed-by: rriggs, prappo
This commit is contained in:
Brian Burkhalter 2016-06-20 14:08:05 -07:00
parent 491d8743c3
commit 432ff69a8b
4 changed files with 15 additions and 17 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -359,10 +359,10 @@ class BufferedInputStream extends FilterInputStream {
* See the general contract of the <code>skip</code>
* method of <code>InputStream</code>.
*
* @exception IOException if the stream does not support seek,
* or if this input stream has been closed by
* invoking its {@link #close()} method, or an
* I/O error occurs.
* @throws IOException if this input stream has been closed by
* invoking its {@link #close()} method,
* {@code in.skip(n)} throws an IOException,
* or an I/O error occurs.
*/
public synchronized long skip(long n) throws IOException {
getBufIfOpen(); // Check for closed stream

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -144,8 +144,7 @@ class FilterInputStream extends InputStream {
*
* @param n the number of bytes to be skipped.
* @return the actual number of bytes skipped.
* @exception IOException if the stream does not support seek,
* or if some other I/O error occurs.
* @throws IOException if {@code in.skip(n)} throws an IOException.
*/
public long skip(long n) throws IOException {
return in.skip(n);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -325,7 +325,7 @@ public abstract class InputStream implements Closeable {
* returns 0, and no bytes are skipped. Subclasses may handle the negative
* value differently.
*
* <p> The <code>skip</code> method of this class creates a
* <p> The <code>skip</code> method implementation of this class creates a
* byte array and then repeatedly reads into it until <code>n</code> bytes
* have been read or the end of the stream has been reached. Subclasses are
* encouraged to provide a more efficient implementation of this method.
@ -333,8 +333,7 @@ public abstract class InputStream implements Closeable {
*
* @param n the number of bytes to be skipped.
* @return the actual number of bytes skipped.
* @exception IOException if the stream does not support seek,
* or if some other I/O error occurs.
* @throws IOException if an I/O error occurs.
*/
public long skip(long n) throws IOException {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -291,10 +291,10 @@ class PushbackInputStream extends FilterInputStream {
*
* @param n {@inheritDoc}
* @return {@inheritDoc}
* @exception IOException if the stream does not support seek,
* or the stream has been closed by
* invoking its {@link #close()} method,
* or an I/O error occurs.
* @throws IOException if the stream has been closed by
* invoking its {@link #close()} method,
* {@code in.skip(n)} throws an IOException,
* or an I/O error occurs.
* @see java.io.FilterInputStream#in
* @see java.io.InputStream#skip(long n)
* @since 1.2