@Test public void openStream_ignoresClose() throws Exception { ReadableBuffer buffer = mock(ReadableBuffer.class); InputStream stream = ReadableBuffers.openStream(buffer, false); stream.close(); verify(buffer, never()).close(); }
public static InputStream openStream(ReadableBuffer buffer, boolean owner) { return new BufferInputStream(owner ? buffer : ignoreClose(buffer)); }
ReadableBuffers { public static InputStream openStream(ReadableBuffer buffer, boolean owner) { return new BufferInputStream(owner ? buffer : ignoreClose(buffer)); } }
ReadableBuffers { public static InputStream openStream(ReadableBuffer buffer, boolean owner) { return new BufferInputStream(owner ? buffer : ignoreClose(buffer)); } private  ReadableBuffers(); }
ReadableBuffers { public static InputStream openStream(ReadableBuffer buffer, boolean owner) { return new BufferInputStream(owner ? buffer : ignoreClose(buffer)); } private  ReadableBuffers(); static ReadableBuffer empty(); static ReadableBuffer wrap(byte[] bytes); static ReadableBuffer wrap(byte[] bytes, int offset, int length); static ReadableBuffer wrap(ByteBuffer bytes); static byte[] readArray(ReadableBuffer buffer); static String readAsString(ReadableBuffer buffer, Charset charset); static String readAsStringUtf8(ReadableBuffer buffer); static InputStream openStream(ReadableBuffer buffer, boolean owner); static ReadableBuffer ignoreClose(ReadableBuffer buffer); }
ReadableBuffers { public static InputStream openStream(ReadableBuffer buffer, boolean owner) { return new BufferInputStream(owner ? buffer : ignoreClose(buffer)); } private  ReadableBuffers(); static ReadableBuffer empty(); static ReadableBuffer wrap(byte[] bytes); static ReadableBuffer wrap(byte[] bytes, int offset, int length); static ReadableBuffer wrap(ByteBuffer bytes); static byte[] readArray(ReadableBuffer buffer); static String readAsString(ReadableBuffer buffer, Charset charset); static String readAsStringUtf8(ReadableBuffer buffer); static InputStream openStream(ReadableBuffer buffer, boolean owner); static ReadableBuffer ignoreClose(ReadableBuffer buffer);  }