Class BinaryRDFWriter

    • Field Detail

      • statementQueue

        private final java.util.Queue<Statement> statementQueue
      • bufferSize

        private int bufferSize
      • nextId

        private int nextId
      • idPool

        private final java.util.Queue<java.lang.Integer> idPool
      • out

        private final java.io.DataOutputStream out
      • formatVersion

        private int formatVersion
      • charset

        private java.nio.charset.Charset charset
      • recycleIds

        private boolean recycleIds
    • Constructor Detail

      • BinaryRDFWriter

        public BinaryRDFWriter​(java.io.OutputStream out)
      • BinaryRDFWriter

        public BinaryRDFWriter​(java.io.OutputStream out,
                               int bufferSize)
    • Method Detail

      • getOutputStream

        public java.io.OutputStream getOutputStream()
        Description copied from interface: ByteSink
        get the OutputStream used by this ByteSink.
        Specified by:
        getOutputStream in interface ByteSink
        Returns:
        an OutputStream
      • handleWriterConfig

        private void handleWriterConfig()
      • endRDF

        public void endRDF()
                    throws RDFHandlerException
        Description copied from interface: RDFHandler
        Signals the end of the RDF data. This method is called when all data has been reported.
        Specified by:
        endRDF in interface RDFHandler
        Throws:
        RDFHandlerException - If the RDF handler has encountered an unrecoverable error.
      • handleNamespace

        public void handleNamespace​(java.lang.String prefix,
                                    java.lang.String uri)
                             throws RDFHandlerException
        Description copied from interface: RDFHandler
        Handles a namespace declaration/definition. A namespace declaration associates a (short) prefix string with the namespace's URI. The prefix for default namespaces, which do not have an associated prefix, are represented as empty strings.
        Specified by:
        handleNamespace in interface RDFHandler
        Overrides:
        handleNamespace in class AbstractRDFWriter
        Parameters:
        prefix - The prefix for the namespace, or an empty string in case of a default namespace.
        uri - The URI that the prefix maps to.
        Throws:
        RDFHandlerException - If the RDF handler has encountered an unrecoverable error.
      • writeStatement

        private void writeStatement()
                             throws RDFHandlerException,
                                    java.io.IOException
        Writes the first statement from the statement queue
        Throws:
        RDFHandlerException
        java.io.IOException
      • incValueFreq

        private void incValueFreq​(Value v)
      • writeURI

        private void writeURI​(IRI uri)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • writeBNode

        private void writeBNode​(BNode bnode)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • writeLiteral

        private void writeLiteral​(Literal literal)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • writeTriple

        private void writeTriple​(Triple triple)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • writeString

        private void writeString​(java.lang.String s)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • writeInt

        private void writeInt​(int i)
                       throws java.io.IOException
        Throws:
        java.io.IOException