palmed.edit.text
Class LineDelimiterInspector

java.lang.Object
  extended by java.io.InputStream
      extended by palmed.edit.text.LineDelimiterInspector
All Implemented Interfaces:
java.io.Closeable

public final class LineDelimiterInspector
extends java.io.InputStream

This class wraps an InputStream in order to detect the line delimiter type.

Version:
$Revision$ $Date$
Author:
Mathieu Champlon

Constructor Summary
LineDelimiterInspector()
          Create a default line delimiter.
LineDelimiterInspector(java.io.InputStream stream)
          Create a line delimiter inspector.
 
Method Summary
 int available()
          
 void close()
          
 void mark(int readlimit)
          
 boolean markSupported()
          
 int read()
          
 int read(byte[] b)
          
 int read(byte[] b, int off, int len)
          
 void reset()
          
 long skip(long n)
          
 java.lang.String toString()
          
 void write(java.io.OutputStream stream)
          Write the delimiter to an output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LineDelimiterInspector

public LineDelimiterInspector(java.io.InputStream stream)
Create a line delimiter inspector.

Parameters:
stream - the stream to wrap

LineDelimiterInspector

public LineDelimiterInspector()
Create a default line delimiter.

Method Detail

read

public int read()
         throws java.io.IOException

Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] b)
         throws java.io.IOException

Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException

Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

write

public void write(java.io.OutputStream stream)
           throws java.io.IOException
Write the delimiter to an output stream.

Parameters:
stream - the stream to write into
Throws:
java.io.IOException - an io exception occurs

available

public int available()
              throws java.io.IOException

Overrides:
available in class java.io.InputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException

mark

public void mark(int readlimit)

Overrides:
mark in class java.io.InputStream

markSupported

public boolean markSupported()

Overrides:
markSupported in class java.io.InputStream

reset

public void reset()
           throws java.io.IOException

Overrides:
reset in class java.io.InputStream
Throws:
java.io.IOException

skip

public long skip(long n)
          throws java.io.IOException

Overrides:
skip in class java.io.InputStream
Throws:
java.io.IOException

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2004-2006 PalmEd. All Rights Reserved.