diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-31 06:34:10 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-31 06:34:10 +0000 |
| commit | 314e43adfc43bf906d8b37453f434b210d908a37 (patch) | |
| tree | 6a277eed8c128f9212b0ef8316750e697701059d /lib/readbytes.rb | |
| parent | 0f66a9142fc880c0483d62ba0e1632c37fd27764 (diff) | |
| download | ruby-314e43adfc43bf906d8b37453f434b210d908a37.tar.gz ruby-314e43adfc43bf906d8b37453f434b210d908a37.tar.xz ruby-314e43adfc43bf906d8b37453f434b210d908a37.zip | |
* ruby.h: use ifdef (or defined) for macro constants that may or
may not be defined to shut up gcc's -Wundef warnings.
[ruby-core:08447]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/readbytes.rb')
| -rw-r--r-- | lib/readbytes.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/readbytes.rb b/lib/readbytes.rb index d6a3b10af..08b92da73 100644 --- a/lib/readbytes.rb +++ b/lib/readbytes.rb @@ -12,6 +12,11 @@ class TruncatedDataError<IOError end class IO + # reads exactly n bytes from the IO stream. + # If the data read is nil, raises EOFError. + # If the data read is too short, raises TruncatedDataError. + # The method TruncatedDataError#data may be used to obtain + # the truncated message. def readbytes(n) str = read(n) if str == nil |
