Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

lrt::NetworkInputStream Class Reference

Stream which reads data through a network from a remote computer. More...

#include <rtnetwork.h>

Inheritance diagram for lrt::NetworkInputStream:

Inheritance graph
[legend]
List of all members.

Public Methods

 ~NetworkInputStream ()
virtual int read ()
 Reads a byte from the stream. More...

virtual int read (Array< char > &b, int off, int len)
 Reads up to len bytes from the stream, storing them in b, beginning at position off. More...

virtual bool eos ()
 Checks if this stream's end has been reached. More...

virtual void close ()
 close() does nothing here, you should close the Socket instead.


Protected Methods

 NetworkInputStream (Socket *sock)

Protected Attributes

Socket * sock

Friends

class Socket

Detailed Description

Stream which reads data through a network from a remote computer.


Member Function Documentation

bool lrt::NetworkInputStream::eos (    )  [virtual]
 

Checks if this stream's end has been reached.

This method must be implemented by subclassers!

Returns:
true if the stream has ended, false if there is still some data to read.

Implements lrt::InputStream.

int lrt::NetworkInputStream::read (  Array< char > &    b,
int    off,
int    len
)  [virtual]
 

Reads up to len bytes from the stream, storing them in b, beginning at position off.

Note that b must be large enough.

Returns:
The number of bytes actually read, or -1 if the stream's end was reached.

Reimplemented from lrt::InputStream.

int lrt::NetworkInputStream::read (    )  [virtual]
 

Reads a byte from the stream.

If the stream cannot be read (or is EOF), this method returns -1. This method must be implemented by subclassers!

Returns:
The byte (in the lowest 8 bits of the returned integer), or -1 if the stream has ended.

Implements lrt::InputStream.


The documentation for this class was generated from the following files:
This is the RoboTour API documentation version 0.1 • Copyright (C) by Florian Fischer