Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Gem::SafeMarshal::Reader#read_bytes
read_bytes(n)
lib/rubygems/safe_marshal/reader.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/rubygems/safe_marshal/reader.rb, line 50
def read_bytes(n)
raise NegativeLengthError if n < 0
str = @io.read(n)
raise EOFError, "expected #{n} bytes, got EOF" if str.nil?
raise DataTooShortError, "expected #{n} bytes, got #{str.inspect}" unless str.bytesize == n
str
end
No documentation available