Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.act365.net
Class GeneralSocketInputStream  view GeneralSocketInputStream download GeneralSocketInputStream.java

java.lang.Object
  extended byjava.io.InputStream
      extended bycom.act365.net.GeneralSocketInputStream
All Implemented Interfaces:
java.io.Closeable

public class GeneralSocketInputStream
extends java.io.InputStream

GeneralSocketInputStream reads from a TCP socket. The class should be used in conjunction with GeneralSocketImpl.


Field Summary
(package private)  int socketDescriptor
           
 
Constructor Summary
GeneralSocketInputStream(int socketDescriptor)
          Creates an input stream to read from the TCP socket with the given descriptor.
 
Method Summary
(package private) static int _close(int socketDescriptor)
           
(package private) static int _read(int socketDescriptor, byte[] buffer, int offset, int count)
           
 void close()
          Closes the input stream.
 int read()
          Reads a single character from the TCP stream.
 int read(byte[] buffer)
          Reads a string of characters from the TCP stream into a buffer.
 int read(byte[] buffer, int offset, int count)
          Reads a string of characters from the TCP stream into a given location in a buffer.
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

socketDescriptor

int socketDescriptor
Constructor Detail

GeneralSocketInputStream

public GeneralSocketInputStream(int socketDescriptor)
Creates an input stream to read from the TCP socket with the given descriptor.

Method Detail

read

public int read()
         throws java.io.IOException
Reads a single character from the TCP stream.


read

public int read(byte[] buffer)
         throws java.io.IOException
Reads a string of characters from the TCP stream into a buffer.


read

public int read(byte[] buffer,
                int offset,
                int count)
         throws java.io.IOException
Reads a string of characters from the TCP stream into a given location in a buffer.


_read

static int _read(int socketDescriptor,
                 byte[] buffer,
                 int offset,
                 int count)

close

public void close()
           throws java.io.IOException
Closes the input stream.


_close

static int _close(int socketDescriptor)