Class: IO

### Home Classes Methods

### In Files

- lib/postgres-pr/message.rb

### Parent

Object

### Methods

- #read_exactly_n_bytes

### Class/Module Index

Quicksearch

- PostgresPR
- PostgresPR::Authentification
- PostgresPR::AuthentificationClearTextPassword
- PostgresPR::AuthentificationCryptPassword
- PostgresPR::AuthentificationKerberosV4
- PostgresPR::AuthentificationKerberosV5
- PostgresPR::AuthentificationMD5Password
- PostgresPR::AuthentificationOk
- PostgresPR::AuthentificationSCMCredential
- PostgresPR::BackendKeyData
- PostgresPR::CommandComplete
- PostgresPR::Connection
- PostgresPR::Connection::Result
- PostgresPR::CopyInResponse
- PostgresPR::CopyOutResponse
- PostgresPR::DataRow
- PostgresPR::DumpError
- PostgresPR::EmptyQueryResponse
- PostgresPR::ErrorResponse
- PostgresPR::Message
- PostgresPR::NoticeErrorMixin
- PostgresPR::NoticeResponse
- PostgresPR::ParameterStatus
- PostgresPR::Parse
- PostgresPR::ParseComplete
- PostgresPR::ParseError
- PostgresPR::PasswordMessage
- PostgresPR::Query
- PostgresPR::ReadyForQuery
- PostgresPR::RowDescription
- PostgresPR::RowDescription::FieldInfo
- PostgresPR::SSLRequest
- PostgresPR::SaltedAuthentificationMixin
- PostgresPR::StartupMessage
- PostgresPR::Terminate
- PostgresPR::UnknownAuthType
- PostgresPR::UnknownMessageType
- Buffer
- Buffer::EOF
- Buffer::Error
- Postgres
- Postgres::Conversion
- Postgres::Conversion::ConversionError
- BinaryReaderMixin
- BinaryWriterMixin
- ByteOrder
- DatabaseError
- Error
- IO
- PGError
- PGconn
- PGresult
- TC_Conversion

No matching classes.

# IO

### Public Instance Methods

read_exactly_n_bytes(n) click to toggle source

    # File lib/postgres-pr/message.rb, line 9
    def read_exactly_n_bytes(n)
      buf = read(n)
      raise EOFError if buf == nil
      return buf if buf.size == n

      n -= buf.size

      while n > 0
        str = read(n)
        raise EOFError if str == nil
        buf << str
        n -= str.size
      end
      return buf
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.