Class V1ContentProducer

java.lang.Object
jp.cssj.driver.ctip.v1.V1ContentProducer

public class V1ContentProducer extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final byte
    A packet that adds a fragment.
    static final byte
    A data packet.
    protected final String
     
    static final byte
    An error that causes information to be missing from the generated document, such as a resource retrieval failure.
    static final byte
    A fatal error that prevents processing from continuing.
    static final byte
    Indicates a warning, such as a CSS syntax error.
    static final byte
    A packet that inserts a fragment.
    protected ChannelIO
     
    static final byte
    An error message packet.
    protected final URI
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    V1ContentProducer(URI uri, String encoding)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    Connects to the server and starts a request.
    int
    Returns the ID of the anchor fragment.
    Returns the message value.
    short
    Returns the message code.
    int
    Returns the fragment ID.
    Returns the message.
    long
    Returns the progress.
    byte
    Returns the data type of the current packet.
    boolean
    Moves the cursor to the next packet.
    int
    read(byte[] b, int off, int len)
    Retrieves data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ADD

      public static final byte ADD
      A packet that adds a fragment.
      See Also:
    • INSERT

      public static final byte INSERT
      A packet that inserts a fragment. Use getAnchorId to obtain the ID of the immediately following fragment.
      See Also:
    • MESSAGE

      public static final byte MESSAGE
      An error message packet. Use getLevel and getMessage to obtain the error level and message.
      See Also:
    • DATA

      public static final byte DATA
      A data packet. Use getId and read to obtain the fragment ID and data.
      See Also:
    • ERROR_WARN

      public static final byte ERROR_WARN
      Indicates a warning, such as a CSS syntax error.
      See Also:
    • ERROR_ERROR

      public static final byte ERROR_ERROR
      An 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_FATAL
      A fatal error that prevents processing from continuing.
      See Also:
    • encoding

      protected final String encoding
    • uri

      protected final URI uri
    • io

      protected ChannelIO io
  • Constructor Details

  • Method Details

    • connect

      public V1RequestConsumer connect() throws IOException
      Connects to the server and starts a request.
      Throws:
      IOException
    • close

      protected void close() throws IOException
      Throws:
      IOException
    • next

      public boolean next() throws IOException
      Moves the cursor to the next packet.
      Returns:
      false if an end packet is received; otherwise true.
      Throws:
      IOException
    • getId

      public int getId() throws IOException
      Returns the fragment ID.
      Returns:
      The fragment ID.
      Throws:
      IOException
    • getAnchorId

      public int getAnchorId() throws IOException
      Returns the ID of the anchor fragment.
      Returns:
      The fragment ID.
      Throws:
      IOException
    • getType

      public byte getType() throws IOException
      Returns the data type of the current packet.
      Returns:
      The packet type.
      Throws:
      IOException
    • getProgress

      public long getProgress() throws IOException
      Returns the progress.
      Returns:
      The number of bytes read by the server.
      Throws:
      IOException
    • getArgs

      public String[] getArgs() throws IOException
      Returns the message value.
      Returns:
      The message value.
      Throws:
      IOException
    • getMessage

      public String getMessage() throws IOException
      Returns the message.
      Returns:
      The message string.
      Throws:
      IOException
    • getCode

      public short getCode() throws IOException
      Returns the message code.
      Returns:
      The message code.
      Throws:
      IOException
    • read

      public int read(byte[] b, int off, int len) throws IOException
      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