private ChannelStream(Ruby runtime, ChannelDescriptor descriptor, boolean autoclose) { this.runtime = runtime; this.descriptor = descriptor; this.modes = descriptor.getOriginalModes(); buffer = ByteBuffer.allocate(BUFSIZE); buffer.flip(); this.reading = true; this.autoclose = autoclose; runtime.addInternalFinalizer(this); }
public static Stream open(Ruby runtime, ChannelDescriptor descriptor, boolean autoclose) { return maybeWrapWithLineEndingWrapper( new ChannelStream(runtime, descriptor, autoclose), descriptor.getOriginalModes()); }