com.onewebsql.util.io
Class CountingReader

java.lang.Object
  extended by java.io.Reader
      extended by java.io.FilterReader
          extended by com.onewebsql.util.io.ProxyReader
              extended by com.onewebsql.util.io.CountReportingReader
                  extended by com.onewebsql.util.io.CountingReader
All Implemented Interfaces:
Closeable, Readable

public class CountingReader
extends CountReportingReader

Implementacja czytacza zliczająca odczytane znaki.


Field Summary
protected  long count
          Liczba odczytanych znaków.
protected  long mark
          Znacznik zapamiętanej pozycji w strumieniu.
 
Fields inherited from class java.io.FilterReader
in
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
CountingReader(Reader reader)
          Konstruktor.
 
Method Summary
 long getCount()
          Zwraca liczbę odczytanych znaków.
 void mark(int idx)
          Invokes the delegate's mark(int) method.
 int read()
          Invokes the delegate's read() method.
 int read(char[] chr)
          Invokes the delegate's read(char[]) method.
 int read(char[] chr, int st, int end)
          Invokes the delegate's read(char[], int, int) method.
 void reset()
          Invokes the delegate's reset() method.
 long skip(long ln)
          Invokes the delegate's skip(long) method.
 
Methods inherited from class com.onewebsql.util.io.ProxyReader
close, markSupported, ready
 
Methods inherited from class java.io.Reader
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

count

protected long count
Liczba odczytanych znaków.


mark

protected long mark
Znacznik zapamiętanej pozycji w strumieniu.

Constructor Detail

CountingReader

public CountingReader(Reader reader)
Konstruktor.

Parameters:
reader - czytacz z którego odczytywane będą znaki.
Method Detail

getCount

public long getCount()
Description copied from class: CountReportingReader
Zwraca liczbę odczytanych znaków.

Specified by:
getCount in class CountReportingReader
Returns:
liczbę odczytanych znaków.

mark

public void mark(int idx)
          throws IOException
Description copied from class: ProxyReader
Invokes the delegate's mark(int) method.

Overrides:
mark in class ProxyReader
Parameters:
idx - read ahead limit
Throws:
IOException - if an I/O error occurs

read

public int read()
         throws IOException
Description copied from class: ProxyReader
Invokes the delegate's read() method.

Overrides:
read in class ProxyReader
Returns:
the character read or -1 if the end of stream
Throws:
IOException - if an I/O error occurs

read

public int read(char[] chr,
                int st,
                int end)
         throws IOException
Description copied from class: ProxyReader
Invokes the delegate's read(char[], int, int) method.

Overrides:
read in class ProxyReader
Parameters:
chr - the buffer to read the characters into
st - The start offset
end - The number of bytes to read
Returns:
the number of characters read or -1 if the end of stream
Throws:
IOException - if an I/O error occurs

read

public int read(char[] chr)
         throws IOException
Description copied from class: ProxyReader
Invokes the delegate's read(char[]) method.

Overrides:
read in class ProxyReader
Parameters:
chr - the buffer to read the characters into
Returns:
the number of characters read or -1 if the end of stream
Throws:
IOException - if an I/O error occurs

reset

public void reset()
           throws IOException
Description copied from class: ProxyReader
Invokes the delegate's reset() method.

Overrides:
reset in class ProxyReader
Throws:
IOException - if an I/O error occurs

skip

public long skip(long ln)
          throws IOException
Description copied from class: ProxyReader
Invokes the delegate's skip(long) method.

Overrides:
skip in class ProxyReader
Parameters:
ln - the number of bytes to skip
Returns:
the number of bytes to skipped or -1 if the end of stream
Throws:
IOException - if an I/O error occurs


Copyright © 2011-2013 e-point SA. All Rights Reserved.