net.rim.device.api.io
Class ScanLine
java.lang.Object
net.rim.device.api.io.LineReader
net.rim.device.api.io.ScanLine
public final class ScanLine
- extends LineReader
Utility class for reading out CRLF delimited lines from a SharedInputStream
.
Sample code
ScanLine scanLine = new
ScanLine( sharedInputStream );
int startPosition = sharedInputStream.getCurrentPosition() -
scanLine.lengthUnreadData();
sharedInputStream.setCurrentPosition( startPosition );
- Since:
- BlackBerry API 4.0.0
Method Summary |
int |
searchForBoundary(byte[] boundary)
Searches for middle and end boundaries. |
ScanLine
public ScanLine(SharedInputStream stream)
- Creates a new ScanLine instance.
- Parameters:
stream
- Shared input stream from which to read the lines.- Since:
- BlackBerry API 4.0.0
searchForBoundary
public int searchForBoundary(byte[] boundary)
throws IOException
- Searches for middle and end boundaries.
MIME uses this method to find the middle and end boundaries.
- Parameters:
boundary
- Boundary to search for.
- Returns:
- 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.
- Throws:
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.- Since:
- BlackBerry API 4.0.0
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal