Class: C0::Stream::DamagedBlockError

Inherits:
Error
  • Object
show all
Defined in:
lib/c0/stream.rb

Overview

A committed block that is not well-formed (DESIGN.md "Damaged Blocks"). resume_offset is where reading can go on: after the block's ETB and payload.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index, resume_offset) ⇒ DamagedBlockError

Returns a new instance of DamagedBlockError.



16
17
18
19
20
# File 'lib/c0/stream.rb', line 16

def initialize(index, resume_offset)
  @index = index
  @resume_offset = resume_offset
  super("block #{index} is damaged; reading can resume at byte #{resume_offset}")
end

Instance Attribute Details

#index ⇒ Object (readonly)

Returns the value of attribute index.



14
15
16
# File 'lib/c0/stream.rb', line 14

def index
  @index
end

#resume_offset ⇒ Object (readonly)

Returns the value of attribute resume_offset.



14
15
16
# File 'lib/c0/stream.rb', line 14

def resume_offset
  @resume_offset
end