You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



All Packages  This Package  Class Hierarchy  Class Search  Index

Class calypso.util.RandomAccessFileWithByteLines

java.lang.Object
   |
   +----calypso.util.RandomAccessFileWithByteLines

public class  RandomAccessFileWithByteLines
     extends java.lang.Object
{
          // Fields 5
     static final int INITBUFSIZE;
     protected byte[] fBuffer;
     protected int fEnd;
     protected RandomAccessFile fInput;
     protected int fOffset;

          // Constructors 1
     public RandomAccessFileWithByteLines(RandomAccessFile);

          // Methods 7
     public boolean eatNewline() throws IOException;
     protected boolean fill() throws IOException;
     protected boolean fillForCapacity(int) throws IOException;
     public long getFilePointer() throws IOException;
     public void readFully(byte[], int, int) throws IOException;
     public boolean readLine(ByteBuf) throws IOException;
     public void seek(long) throws IOException;
}



Fields


INITBUFSIZE

   static final int INITBUFSIZE


fInput

   protected RandomAccessFile fInput


fBuffer

   protected byte[] fBuffer


fOffset

   protected int fOffset


fEnd

   protected int fEnd



Constructors


RandomAccessFileWithByteLines

   public RandomAccessFileWithByteLines(RandomAccessFile f) 



Methods


readLine

   public boolean readLine(ByteBuf buf)  throws IOException


eatNewline

   public boolean eatNewline()  throws IOException

Eat up one newline if present in the fBuffer. If a newline was eaten up return true otherwise false. This will handle mac (\r), unix (\n) and windows (\r\n) style of newlines transparently.



getFilePointer

   public long getFilePointer()  throws IOException


seek

   public void seek(long loc)  throws IOException


fill

   protected boolean fill()  throws IOException


fillForCapacity

   protected boolean fillForCapacity(int capacity)  throws IOException

Fill the fBuffer, keeping whatever is unread in the fBuffer and ensuring that "capacity" characters of total filled fBuffer space is available. Return false if the final amount of data in the fBuffer is less than capacity, otherwise return true.



readFully

   public void readFully(byte[] arr, 
                         int off, 
                         int length)  throws IOException


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