Class BinaryQueryResultParser

    • Field Detail

      • in

        private java.io.DataInputStream in
      • formatVersion

        private int formatVersion
      • charsetDecoder

        private final java.nio.charset.CharsetDecoder charsetDecoder
      • logger

        private static final org.slf4j.Logger logger
      • namespaceArray

        private java.lang.String[] namespaceArray
    • Constructor Detail

      • BinaryQueryResultParser

        public BinaryQueryResultParser()
        Creates a new parser for the binary query result format that will use an instance of SimpleValueFactory to create Value objects.
      • BinaryQueryResultParser

        public BinaryQueryResultParser​(ValueFactory valueFactory)
        Creates a new parser for the binary query result format that will use the supplied ValueFactory to create Value objects.
    • Method Detail

      • processNamespace

        private void processNamespace()
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • readQName

        private IRI readQName()
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • readURI

        private IRI readURI()
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • readBnode

        private BNode readBnode()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • readString

        private java.lang.String readString()
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • extractInvalidContentAsString

        private java.lang.String extractInvalidContentAsString​(int recordTypeMarker)
                                                        throws java.io.IOException
        Used when trying to parse some invalid content. Reads the remaining bytes as string in order to provide more user-friendly error message. Sets the max limit of the returned string, if its length > INVALID_CONTENT_LIMIT, the returned string is trimmed and "..." is appended in order to prevent displaying too long result.
        Throws:
        java.io.IOException
      • readStringV1

        private java.lang.String readStringV1()
                                       throws java.io.IOException
        Reads a string from the version 1 format, i.e. in Java's {@link DataInput#modified-utf-8 Modified UTF-8}.
        Throws:
        java.io.IOException
      • readStringV2

        private java.lang.String readStringV2()
                                       throws java.io.IOException
        Reads a string from the version 2 format. Strings are encoded as UTF-8 and are preceeded by a 32-bit integer (high byte first) specifying the length of the encoded string.
        Throws:
        java.io.IOException
      • readTriple

        private Triple readTriple()
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • readDirectValue

        private Value readDirectValue()
                               throws java.io.IOException
        Throws:
        java.io.IOException