@Override public void close() throws IOException { if (mode == Mode.SYNCHRONOUS) { synchronousStream.close(); } }
private void checkThrowable() throws IOException { final Object o = queueStatus.get(); if (o != null && o != EOF) { // should be faster than instanceof // if not null or EOF, then it must be Throwable if (queueStatus.compareAndSet(o, EOF)) { // clear throwable flag and throw exception try { throw new IOException((Throwable) o); } finally { close(); } } } }
private void checkThrowable() throws IOException { final Object o = queueStatus.get(); if (o != null && o != EOF) { // should be faster than instanceof // if not null or EOF, then it must be Throwable if (queueStatus.compareAndSet(o, EOF)) { // clear throwable flag and throw exception try { throw new IOException((Throwable) o); } finally { close(); } } } }
private void checkThrowable() throws IOException { final Object o = queueStatus.get(); if (o != null && o != EOF) { // should be faster than instanceof // if not null or EOF, then it must be Throwable if (queueStatus.compareAndSet(o, EOF)) { // clear throwable flag and throw exception try { throw new IOException((Throwable) o); } finally { close(); } } } }
private void checkThrowable() throws IOException { final Object o = queueStatus.get(); if (o != null && o != EOF) { // should be faster than instanceof // if not null or EOF, then it must be Throwable if (queueStatus.compareAndSet(o, EOF)) { // clear throwable flag and throw exception try { throw new IOException((Throwable) o); } finally { close(); } } } }
private void checkThrowable() throws IOException { final Object o = queueStatus.get(); if (o != null && o != EOF) { // should be faster than instanceof // if not null or EOF, then it must be Throwable if (queueStatus.compareAndSet(o, EOF)) { // clear throwable flag and throw exception try { throw new IOException((Throwable) o); } finally { close(); } } } }
private void checkThrowable() throws IOException { final Object o = queueStatus.get(); if (o != null && o != EOF) { // should be faster than instanceof // if not null or EOF, then it must be Throwable if (queueStatus.compareAndSet(o, EOF)) { // clear throwable flag and throw exception try { throw new IOException((Throwable) o); } finally { close(); } } } }
private void checkThrowable() throws IOException { final Object o = queueStatus.get(); if (o != null && o != EOF) { // should be faster than instanceof // if not null or EOF, then it must be Throwable if (queueStatus.compareAndSet(o, EOF)) { // clear throwable flag and throw exception try { throw new IOException((Throwable) o); } finally { close(); } } } }