All Packages  This Package  Class Hierarchy  Class Search  Index

Inner Class edu.utah.janos.nodeos.pj_ANEPStreamLayer.StreamReader
java.lang.Object
   |
   +----edu.utah.janos.nodeos.pj_ANEPStreamLayer.StreamReader

  Summary

protected abstract static class  pj_ANEPStreamLayer.StreamReader
     extends java.lang.Object
     implements java.lang.Runnable
{
          // Fields 3
     private final InputStream is;
     private final pj_BufferHandle pb;
     private int users;

          // Constructors 1
     protected StreamReader(InputStream, pj_BufferHandle);

          // Methods 6
     protected void acquire();
     protected abstract boolean handlePacket(pj_BufferHandle);
     private void read(byte[], int, int) throws IOException;
     private void readANEPPacketInto(pj_BufferHandle) throws IOException;
     protected boolean release();
     public void run();
}

StreamReader is an inner class used to read from an InputStream and produce PacketBuffer's. The stream is expected to contain only ANEP packets since the length of the packet encoded in the ANEP header is used to delimit the beginning and end of packets.


  Cross Reference

Extended By:
pj_StdinStreamLayer.StdinStreamReader, pj_TCPStreamLayer.TCPStreamReader





  Fields

· is

Summary  |  Top
   private final InputStream is


· users

Summary  |  Top
   private int users


· pb

Summary  |  Top
   private final pj_BufferHandle pb


  Constructors

· StreamReader

Summary  |  Top

   protected StreamReader(InputStream is, 
                          pj_BufferHandle pb) 


  Methods

· acquire

Summary  |  Top
   protected void acquire() 


· release

Summary  |  Top
   protected boolean release() 


· handlePacket

Summary  |  Top
   protected abstract boolean handlePacket(pj_BufferHandle pb) 

Handle a packet parsed out of the stream



· read

Summary  |  Top
   private void read(byte[] data, 
                     int offset, 
                     int len)  throws IOException

Helper function for always reading the specified amount of data.



· readANEPPacketInto

Summary  |  Top
   private void readANEPPacketInto(pj_BufferHandle bh)  throws IOException


· run

Summary  |  Top
   public void run() 
Implements:
run in interface Runnable


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7