Example usage for java.nio.channels SeekableByteChannel isOpen

List of usage examples for java.nio.channels SeekableByteChannel isOpen

Introduction

In this page you can find the example usage for java.nio.channels SeekableByteChannel isOpen.

Prototype

public boolean isOpen();

Source Link

Document

Tells whether or not this channel is open.

Usage

From source file:com.spectralogic.ds3client.helpers.channels.WindowedSeekableByteChannel_Test.java

@Test(timeout = 1000)
public void closeChangesIsOpen() throws IOException {
    try (final SeekableByteChannel channel = stringToChannel("aabbbcccc")) {
        final Object lock = new Object();
        final SeekableByteChannel window = new WindowedSeekableByteChannel(channel, lock, 0L, 2L);
        assertThat(window.isOpen(), is(true));
        window.close();//from w w  w.j a  v a  2s  .c om
        assertThat(window.isOpen(), is(false));
    }
}