Class IntEncoderFilter

    • Constructor Detail

      • IntEncoderFilter

        protected IntEncoderFilter​(IntEncoder encoder)
    • Method Detail

      • close

        public void close()
                   throws IOException
        Description copied from class: IntEncoder
        Instructs the encoder to finish the encoding process. This method closes the output stream which was specified by reInit. An implementation may do here additional cleanup required to complete the encoding, such as flushing internal buffers, etc.
        Once this method was called, no further calls to encode should be made before first calling reInit.

        NOTE: overriding classes should make sure they either call super.close() or close the output stream themselves.

        Overrides:
        close in class IntEncoder
        Throws:
        IOException
      • reInit

        public void reInit​(OutputStream out)
        Description copied from class: IntEncoder
        Reinitializes the encoder with the give OutputStream. For re-usability it can be changed without the need to reconstruct a new object.

        NOTE: after calling IntEncoder.close(), one must call this method even if the output stream itself hasn't changed. An example case is that the output stream wraps a byte[], and the output stream itself is reset, but its instance hasn't changed. Some implementations of IntEncoder may write some metadata about themselves to the output stream, and therefore it is imperative that one calls this method before encoding any data.

        Overrides:
        reInit in class IntEncoder