Beispiel #1
0
 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);
 }
Beispiel #2
0
 public static Stream open(Ruby runtime, ChannelDescriptor descriptor, boolean autoclose) {
   return maybeWrapWithLineEndingWrapper(
       new ChannelStream(runtime, descriptor, autoclose), descriptor.getOriginalModes());
 }