Class ScanLine


public final class ScanLine
extends LineReader

Utility class for reading out CRLF delimited lines from a SharedInputStream.

JDE 4.0.0

Fields inherited from class
_buffer, _bufferLength, _bufferOffset, _stream, BUFFER_LENGTH
Constructor Summary
ScanLine(SharedInputStream stream)
          Creates a new ScanLine instance.
Method Summary
 int searchForBoundary(byte[] boundary)
          Searches for middle and end boundaries.
Methods inherited from class
getBuffer, getBufferLength, getBufferOffset, getStream, lengthUnreadData, readLine, setBufferLength, setBufferOffset
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ScanLine(SharedInputStream stream)
Creates a new ScanLine instance.
stream - Shared input stream from which to read the lines.
JDE 4.0.0
Method Detail


public int searchForBoundary(byte[] boundary)
                      throws IOException
Searches for middle and end boundaries.

MIME uses this method to find the middle and end boundaries.

boundary - Boundary to search for.
An integer value in which the lower bit tells if this is the final boundary or not and the remaining bits provide the number of positions to move back in the stream to the front of the boundary.
IllegalArugmentException - If you provide a null boundary, or one with a length larger than 70.
IOException - If end of line reached and no boundary located.
JDE 4.0.2

Copyright 1999-2004 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.