kom.tools.web
Class ReadFile

java.lang.Object
  |
  +--kom.tools.web.ReadFile

public class ReadFile
extends java.lang.Object


Field Summary
protected  byte[] buf
           
protected  boolean eos
           
(package private)  java.io.InputStream in
           
protected  int length
           
 boolean nl
           
protected static int NL
           
protected  int pos
           
static int SIZE
           
 long totalNL
           
 long totalPass
           
 long totalRead
           
 
Constructor Summary
ReadFile(java.io.InputStream in)
          Constructor.
 
Method Summary
protected  void actualize()
          Resets pos and length if required
 void close()
          Closes the file
protected  int index(int c)
          Looks up a byte in the buffer
 java.io.ByteArrayOutputStream readLine()
          Reads a line from a file The lines should be separated with LF (10)
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

SIZE

public static final int SIZE

buf

protected byte[] buf

length

protected int length

eos

protected boolean eos

pos

protected int pos

NL

protected static final int NL

in

java.io.InputStream in

nl

public boolean nl

totalRead

public long totalRead

totalPass

public long totalPass

totalNL

public long totalNL
Constructor Detail

ReadFile

public ReadFile(java.io.InputStream in)
Constructor.
Parameters:
in - InputStream
Method Detail

index

protected int index(int c)
Looks up a byte in the buffer
Parameters:
c - byte
Returns:
index in buffer, or -1

actualize

protected void actualize()
Resets pos and length if required

readLine

public java.io.ByteArrayOutputStream readLine()
Reads a line from a file The lines should be separated with LF (10)
Returns:
ByteArrayOutputStream for line (not including NL), or null

close

public void close()
Closes the file