Class ContentBufferInputStream

java.lang.Object
java.io.InputStream
xyz.cofe.cbuffer.ContentBufferInputStream
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable

public class ContentBufferInputStream
extends java.io.InputStream
Чтение из буфера
Author:
user
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected long beginIndex  
    protected ContentBuffer contentBuffer  
    protected long endIndexExclusive  
    protected java.util.concurrent.locks.Lock lock  
    protected long pointer  
  • Constructor Summary

    Constructors 
    Constructor Description
    ContentBufferInputStream​(ContentBuffer buffer)
    Конструктор
    ContentBufferInputStream​(ContentBuffer buffer, long beginIndex)
    Конструктор
    ContentBufferInputStream​(ContentBuffer buffer, long beginIndex, long endIndexExclusive)
    Конструктор
    ContentBufferInputStream​(ContentBuffer buffer, long beginIndex, long endIndexExclusive, java.util.concurrent.locks.Lock lock)
    Конструктор
  • Method Summary

    Modifier and Type Method Description
    void close()  
    int read()  
    int read​(byte[] b)  
    int read​(byte[] b, int off, int len)  
    long skip​(long n)  

    Methods inherited from class java.io.InputStream

    available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ContentBufferInputStream

      public ContentBufferInputStream​(ContentBuffer buffer, long beginIndex, long endIndexExclusive, java.util.concurrent.locks.Lock lock)
      Конструктор
      Parameters:
      buffer - буффер
      beginIndex - начальный индекс
      endIndexExclusive - конечный индекс или -1
      lock - блокировка или null
    • ContentBufferInputStream

      public ContentBufferInputStream​(ContentBuffer buffer, long beginIndex, long endIndexExclusive)
      Конструктор
      Parameters:
      buffer - буффер
      beginIndex - начальный индекс
      endIndexExclusive - конечный индекс или -1
    • ContentBufferInputStream

      public ContentBufferInputStream​(ContentBuffer buffer, long beginIndex)
      Конструктор
      Parameters:
      buffer - буффер
      beginIndex - начальный индекс
    • ContentBufferInputStream

      public ContentBufferInputStream​(ContentBuffer buffer)
      Конструктор
      Parameters:
      buffer - буффер
  • Method Details

    • 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[] b, int off, int len) throws java.io.IOException
      Overrides:
      read in class java.io.InputStream
      Throws:
      java.io.IOException
    • read

      public int read​(byte[] b) throws java.io.IOException
      Overrides:
      read in class java.io.InputStream
      Throws:
      java.io.IOException
    • close

      public void close() throws java.io.IOException
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface java.io.Closeable
      Overrides:
      close in class java.io.InputStream
      Throws:
      java.io.IOException
    • skip

      public long skip​(long n) throws java.io.IOException
      Overrides:
      skip in class java.io.InputStream
      Throws:
      java.io.IOException