Package i2p.susi.util

Class ReadBuffer

  • All Implemented Interfaces:
    Buffer

    public class ReadBuffer
    extends Object
    implements Buffer
    Input only for constant data, initialized from a byte array. See MemoryBuffer for read/write.
    Author:
    susi
    • Field Detail

      • content

        public final byte[] content
      • length

        public final int length
      • offset

        public final int offset
    • Constructor Detail

      • ReadBuffer

        public ReadBuffer​(byte[] content,
                          int offset,
                          int length)
    • Method Detail

      • getInputStream

        public InputStream getInputStream()
        Specified by:
        getInputStream in interface Buffer
        Returns:
        new ByteArrayInputStream over the content
        Since:
        0.9.34
      • readComplete

        public void readComplete​(boolean success)
        Does nothing
        Specified by:
        readComplete in interface Buffer
        Since:
        0.9.34
      • writeComplete

        public void writeComplete​(boolean success)
        Does nothing
        Specified by:
        writeComplete in interface Buffer
        Parameters:
        success - if false, deletes any resources
        Since:
        0.9.34
      • getLength

        public int getLength()
        Always valid
        Specified by:
        getLength in interface Buffer
      • getOffset

        public int getOffset()
        Always valid
        Specified by:
        getOffset in interface Buffer