All Known Implementing Classes:
NodecSSE

public interface Nodec
Encode/decode for Nodes into bytes
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.jena.graph.Node
    decode(ByteBuffer bb, org.apache.jena.shared.PrefixMapping pmap)
    Decode the node from the byte buffer.
    int
    encode(org.apache.jena.graph.Node node, ByteBuffer bb, org.apache.jena.shared.PrefixMapping pmap)
    Encode the node into the byte buffer, starting at the given offset.
    int
    maxSize(org.apache.jena.graph.Node node)
    Calculate the maximum number of bytes needed for a Node.
  • Method Details

    • maxSize

      int maxSize(org.apache.jena.graph.Node node)
      Calculate the maximum number of bytes needed for a Node. This needs to be an overestimate and is used to ensure there is space in the bytebuffer passed to encode.
    • encode

      int encode(org.apache.jena.graph.Node node, ByteBuffer bb, org.apache.jena.shared.PrefixMapping pmap)
      Encode the node into the byte buffer, starting at the given offset. The ByteBuffer will have position/limit around the space used on return, without a length code.
      Parameters:
      node - Node to encode.
      bb - ByteBuffer
      pmap - Optional prefix mapping. Can be null.
      Returns:
      Length of byte buffer used for the whole encoding.
    • decode

      org.apache.jena.graph.Node decode(ByteBuffer bb, org.apache.jena.shared.PrefixMapping pmap)
      Decode the node from the byte buffer. The ByteBuffer position should be the start of the encoding (no binary length for example)
      Parameters:
      bb - ByteBuffer
      pmap - Optional prefix mapping. Can be null.
      Returns:
      the decoded Node.