Class: Virgil::Crypto::VirgilStreamDataSink

Inherits:
Core::VirgilDataSink
  • Object
show all
Defined in:
lib/virgil/crypto/stream_data_sink.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream) ⇒ VirgilStreamDataSink

Returns a new instance of VirgilStreamDataSink.



40
41
42
43
# File 'lib/virgil/crypto/stream_data_sink.rb', line 40

def initialize(stream)
  @stream = stream
  super()
end

Instance Attribute Details

#streamObject (readonly)

Returns the value of attribute stream.



38
39
40
# File 'lib/virgil/crypto/stream_data_sink.rb', line 38

def stream
  @stream
end

Instance Method Details

#is_goodObject



45
46
47
# File 'lib/virgil/crypto/stream_data_sink.rb', line 45

def is_good
  !stream.closed?
end

#write(data) ⇒ Object



49
50
51
# File 'lib/virgil/crypto/stream_data_sink.rb', line 49

def write(data)
  stream.write(data.pack('c*'))
end