The Mozilla
Organization
Our Mission
Who We Are
Getting Involved
Community
Editorials
What's New
Newsbot
Development
Roadmap
Module Owners
Blue Sky
Projects
Status
Tools
Products
Source Code
Binaries
Documentation
License Terms
Bug Reports
Quality
Search
Feedback
Class calypso.util.RandomAccessFileWithByteLines
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

Copyright © 1998-1999 The Mozilla Organization.