Class: BRS::Stream::Raw::Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/brs/stream/raw/abstract.rb

Direct Known Subclasses

Compressor, Decompressor

Instance Method Summary collapse

Constructor Details

#initialize(native_stream) ⇒ Abstract

Returns a new instance of Abstract.



13
14
15
16
# File 'lib/brs/stream/raw/abstract.rb', line 13

def initialize(native_stream)
  @native_stream = native_stream
  @is_closed     = false
end

Instance Method Details

#close(&writer) ⇒ Object



44
45
46
47
48
49
50
51
# File 'lib/brs/stream/raw/abstract.rb', line 44

def close(&writer)
  write_result(&writer)

  @native_stream.close
  @is_closed = true

  nil
end

#closed?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/brs/stream/raw/abstract.rb', line 53

def closed?
  @is_closed
end

#flush(&writer) ⇒ Object

– write –



20
21
22
23
24
# File 'lib/brs/stream/raw/abstract.rb', line 20

def flush(&writer)
  write_result(&writer)

  nil
end