Class SocketHelper.ByteArrayBackedInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Enclosing class:
    SocketHelper

    public static class SocketHelper.ByteArrayBackedInputStream
    extends java.io.InputStream
    Input stream backed by a list of byte arrays.
    • Constructor Summary

      Constructors 
      Constructor Description
      ByteArrayBackedInputStream​(byte[] buffer)
      Consruct a SocketHelper$ByteArrayBackedInputStream object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void append​(byte[] buffer)
      Append to the input stream.
      int read()  
      int read​(byte[] bytes, int offset, int length)  
      void reset()  
      • Methods inherited from class java.io.InputStream

        available, close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, skip, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ByteArrayBackedInputStream

        public ByteArrayBackedInputStream​(byte[] buffer)
        Consruct a SocketHelper$ByteArrayBackedInputStream object.
        Parameters:
        buffer - an array of bytes
    • Method Detail

      • append

        public void append​(byte[] buffer)
        Append to the input stream.
        Parameters:
        buffer - the buffer to be appended.
      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] bytes,
                        int offset,
                        int length)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • reset

        public void reset()
        Overrides:
        reset in class java.io.InputStream