| java.io.PushbackInputStream org.apache.cocoon.servlet.multipart.TokenStream
TokenStream | class TokenStream extends PushbackInputStream (Code) | | Utility class for MultipartParser. Divides the inputstream into parts
separated by a given boundary.
A newline is espected after each boundary and is parsed away.
author: Jeroen ter Voorde version: CVS $Id: TokenStream.java 433543 2006-08-22 06:22:54Z crossley $ |
Method Summary | |
public int | getState() | public void | nextPart() Start reading the next part in the stream. | public int | read(byte[] out) | public int | read(byte[] out, int off, int len) | public int | read() | public void | setBoundary(byte[] boundary) |
STATE_ENDMULTIPART | final public static int STATE_ENDMULTIPART(Code) | | Read last boundary, end of multipart block
|
STATE_ENDOFSTREAM | final public static int STATE_ENDOFSTREAM(Code) | | End of stream, this should not happen
|
STATE_NEXTPART | final public static int STATE_NEXTPART(Code) | | Fully read a part, now at the beginning of a new part
|
STATE_NOBOUNDARY | final public static int STATE_NOBOUNDARY(Code) | | Initial state, no boundary has been set.
|
STATE_READING | final public static int STATE_READING(Code) | | Currently reading a part
|
TokenStream | public TokenStream(PushbackInputStream in)(Code) | | Creates a new pushback token stream from in.
Parameters: in - The input stream |
TokenStream | public TokenStream(PushbackInputStream in, int size)(Code) | | Creates a new pushback token stream from in.
Parameters: in - The input stream Parameters: size - Size (in bytes) of the pushback buffer |
getState | public int getState()(Code) | | Return the stream state
|
nextPart | public void nextPart() throws MultipartException(Code) | | Start reading the next part in the stream. This method may only be called
if state is STATE_NEXTPART. It will throw a MultipartException if not.
throws: MultipartException - |
|
|