Package io.protostuff

Class Pipe


  • public abstract class Pipe
    extends java.lang.Object
    Transfers data from an Input to an Output.

    It is recommended to use pipe only to stream data coming from server-side services (e.g from your datastore/etc).

    Incoming data from the interwebs should not be piped due to validation/security purposes.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Pipe.Schema<T>
      Schema for transferring data from a source (Input) to a different sink (Output).
    • Constructor Summary

      Constructors 
      Constructor Description
      Pipe()  
    • Field Detail

      • input

        protected Input input
      • output

        protected Output output
    • Constructor Detail

      • Pipe

        public Pipe()
    • Method Detail

      • reset

        protected Pipe reset()
        Resets this pipe for re-use.
      • begin

        protected abstract Input begin​(Pipe.Schema<?> pipeSchema)
                                throws java.io.IOException
        Begin preliminary input processing.
        Throws:
        java.io.IOException
      • end

        protected abstract void end​(Pipe.Schema<?> pipeSchema,
                                    Input input,
                                    boolean cleanupOnly)
                             throws java.io.IOException
        End input processing.

        If cleanupOnly is true, the io processing ended prematurely hence the underlying pipe should cleanup/close all resources that need to be.

        Throws:
        java.io.IOException
      • transferDirect

        public static <T> void transferDirect​(Pipe.Schema<T> pipeSchema,
                                              Pipe pipe,
                                              Input input,
                                              Output output)
                                       throws java.io.IOException
        This should not be called directly by applications.
        Throws:
        java.io.IOException