Package jp.cssj.driver.ctip.v1
Class V1ContentProducer
java.lang.Object
jp.cssj.driver.ctip.v1.V1ContentProducer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteA packet that adds a fragment.static final byteA data packet.protected final Stringstatic final byteAn error that causes information to be missing from the generated document, such as a resource retrieval failure.static final byteA fatal error that prevents processing from continuing.static final byteIndicates a warning, such as a CSS syntax error.static final byteA packet that inserts a fragment.protected ChannelIOstatic final byteAn error message packet.protected final URI -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclose()connect()Connects to the server and starts a request.intReturns the ID of the anchor fragment.String[]getArgs()Returns the message value.shortgetCode()Returns the message code.intgetId()Returns the fragment ID.Returns the message.longReturns the progress.bytegetType()Returns the data type of the current packet.booleannext()Moves the cursor to the next packet.intread(byte[] b, int off, int len) Retrieves data.
-
Field Details
-
ADD
public static final byte ADDA packet that adds a fragment.- See Also:
-
INSERT
public static final byte INSERTA packet that inserts a fragment. Use getAnchorId to obtain the ID of the immediately following fragment.- See Also:
-
MESSAGE
public static final byte MESSAGEAn error message packet. Use getLevel and getMessage to obtain the error level and message.- See Also:
-
DATA
public static final byte DATAA data packet. Use getId and read to obtain the fragment ID and data.- See Also:
-
ERROR_WARN
public static final byte ERROR_WARNIndicates a warning, such as a CSS syntax error.- See Also:
-
ERROR_ERROR
public static final byte ERROR_ERRORAn error that causes information to be missing from the generated document, such as a resource retrieval failure.- See Also:
-
ERROR_FATAL
public static final byte ERROR_FATALA fatal error that prevents processing from continuing.- See Also:
-
encoding
-
uri
-
io
-
-
Constructor Details
-
V1ContentProducer
- Throws:
IOException
-
-
Method Details
-
connect
Connects to the server and starts a request.- Throws:
IOException
-
close
- Throws:
IOException
-
next
Moves the cursor to the next packet.- Returns:
- false if an end packet is received; otherwise true.
- Throws:
IOException
-
getId
Returns the fragment ID.- Returns:
- The fragment ID.
- Throws:
IOException
-
getAnchorId
Returns the ID of the anchor fragment.- Returns:
- The fragment ID.
- Throws:
IOException
-
getType
Returns the data type of the current packet.- Returns:
- The packet type.
- Throws:
IOException
-
getProgress
Returns the progress.- Returns:
- The number of bytes read by the server.
- Throws:
IOException
-
getArgs
Returns the message value.- Returns:
- The message value.
- Throws:
IOException
-
getMessage
Returns the message.- Returns:
- The message string.
- Throws:
IOException
-
getCode
Returns the message code.- Returns:
- The message code.
- Throws:
IOException
-
read
Retrieves data.- Parameters:
b- The buffer in which to store the data.off- The starting position in the buffer.len- The number of bytes the buffer can hold.- Returns:
- The length of the retrieved data, or -1 if there is no data.
- Throws:
IOException
-