class QuartzTorrent::EmptyBitfield
A bitfield that is always empty.
Attributes
Length of the Bitfield
in bits.
Public Class Methods
# File lib/quartz_torrent/bitfield.rb, line 230 def initialize @length = 0 end
Public Instance Methods
Are all bits in the Bitfield
clear?
# File lib/quartz_torrent/bitfield.rb, line 261 def allClear? true end
Are all bits in the Bitfield
set?
# File lib/quartz_torrent/bitfield.rb, line 256 def allSet? false end
Length of the Bitfield
in bytes.
# File lib/quartz_torrent/bitfield.rb, line 238 def byteLength 0 end
Clear the bit at index ‘bit’ to 0.
# File lib/quartz_torrent/bitfield.rb, line 247 def clear(bit) end
Clear all bits in the field to 0.
# File lib/quartz_torrent/bitfield.rb, line 270 def clearAll end
Calculate the compliment of this bitfield, and return the result as a new bitfield.
# File lib/quartz_torrent/bitfield.rb, line 297 def compliment self end
Update this bitfield to be the compliment of itself.
# File lib/quartz_torrent/bitfield.rb, line 302 def compliment! self end
Set the contents of this bitfield to be the same as the passed bitfield. An exception is thrown if the passed bitfield is smaller than this.
# File lib/quartz_torrent/bitfield.rb, line 292 def copyFrom(bitfield) end
Count the number of bits that are set. Slow: could use lookup table.
# File lib/quartz_torrent/bitfield.rb, line 321 def countSet 0 end
Calculate the intersection of this bitfield and the passed bitfield, and return the result as a new bitfield.
# File lib/quartz_torrent/bitfield.rb, line 281 def intersection(bitfield) self end
Update this bitfield to be the intersection of this bitfield and the passed bitfield.
# File lib/quartz_torrent/bitfield.rb, line 286 def intersection!(bitfield) self end
Serialize this bitfield as a string.
# File lib/quartz_torrent/bitfield.rb, line 307 def serialize "" end
Set the bit at index ‘bit’ to 1.
# File lib/quartz_torrent/bitfield.rb, line 243 def set(bit) end
Returns true if the bit is set, false otherwise.
# File lib/quartz_torrent/bitfield.rb, line 251 def set?(bit) false end
Set all bits in the field to 1.
# File lib/quartz_torrent/bitfield.rb, line 266 def setAll end
Return a display string representing the bitfield.
# File lib/quartz_torrent/bitfield.rb, line 316 def to_s(groupsOf = 8) "empty" end
Calculate the union of this bitfield and the passed bitfield, and return the result as a new bitfield.
# File lib/quartz_torrent/bitfield.rb, line 275 def union(bitfield) self end
Unserialize this bitfield from a string.
# File lib/quartz_torrent/bitfield.rb, line 312 def unserialize(s) end