Class PrependableSocket

    • Method Detail

      • prependToInputStream

        public void prependToInputStream​(byte[] bytes,
                                         int offset,
                                         int length)
                                  throws IOException
        Prepend some bytes that have already been read back to the socket's input stream. Note that this method can be called at most once with a non-0 length per socket instance.
        Parameters:
        bytes - the bytes to prepend.
        offset - offset in the byte array to start at.
        length - number of bytes to prepend.
        Throws:
        IOException - if this method was already called on the socket instance, or if super.getInputStream() throws.