@Override public void seek(long pos) throws IOException { if (pos < 0) { throw new EOFException(FSExceptionMessages.NEGATIVE_SEEK); } if (in == null) { throw new SwiftConnectionClosedException(FSExceptionMessages.STREAM_IS_CLOSED); } super.seek(pos); }
@Override public void seek(long pos) throws IOException { if (pos < 0) { throw new IOException("Negative position"); } if (in == null) { throw new SwiftConnectionClosedException("Stream closed"); } super.seek(pos); }
/** * Assume that the connection is not released: throws an exception if it is * @throws SwiftConnectionClosedException */ private synchronized void assumeNotReleased() throws SwiftConnectionClosedException { if (released || inStream == null) { throw new SwiftConnectionClosedException(reasonClosed); } }
/** * check that the output stream is open * * @throws SwiftException if it is not */ private synchronized void verifyOpen() throws SwiftException { if (closed) { throw new SwiftConnectionClosedException(); } }
/** * Assume that the connection is not closed: throws an exception if it is * @throws SwiftConnectionClosedException */ private void verifyOpen() throws SwiftConnectionClosedException { if (httpStream == null) { throw new SwiftConnectionClosedException(reasonClosed); } }