code: public static Pipe newPipe(byte[] data, int offset, int len)
      {
          final ByteArrayInput byteArrayInput = new ByteArrayInput(data, offset, len, false);
          return new Pipe()
          {
              protected Input begin(Pipe.Schema<?> pipeSchema) throws IOException
              {
                  return byteArrayInput;
              }
              protected void end(Pipe.Schema<?> pipeSchema, Input input, 
                      boolean cleanupOnly) throws IOException
              {
                  if(cleanupOnly)
                      return;
                  
                  assert input == byteArrayInput;
              }
          };
      }
docs: Creates a protobuf pipe from a byte array.