/[classpath]/classpath/gnu/CORBA/CDR/aligningInputStream.java
ViewVC logotype

Diff of /classpath/gnu/CORBA/CDR/aligningInputStream.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by mark, Sat Jul 2 20:32:09 2005 UTC revision 1.5 by audriusa, Sun Oct 2 19:58:00 2005 UTC
# Line 67  public class aligningInputStream Line 67  public class aligningInputStream
67    }    }
68    
69    /**    /**
    * Create a stream, reading from the given buffer region.  
    *  
    * @param a_buffer a buffer to read from.  
    * @param offset the offset of the region.  
    * @param length thr length of the region.  
    */  
   public aligningInputStream(byte[] a_buffer, int offset, int length)  
   {  
     super(a_buffer, offset, length);  
   }  
   
   /**  
70     * Set the alignment offset, if the index of the first byte in the     * Set the alignment offset, if the index of the first byte in the
71     * stream is different from 0.     * stream is different from 0.
72     */     */
# Line 119  public class aligningInputStream Line 107  public class aligningInputStream
107    {    {
108      return buf;      return buf;
109    }    }
110      
111      /**
112       * Get the current position in the buffer.
113       *
114       * @return The position in the buffer, taking offset into consideration.
115       */
116      public int getPosition()
117      {
118        return pos + offset;
119      }  
120      
121      /**
122       * Jump to the given position, taking offset into consideration.
123       */
124      public void seek(int position)
125      {
126        if (position < offset || position > (count+offset))
127          throw new ArrayIndexOutOfBoundsException(position
128            + " is out of valid ["+offset+".." + (count+offset) + "[ range");
129        pos = position - offset;
130      }  
131  }  }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26