trait BufferingInputStreamParser extends BufferingByteParser

Defines common functionality to any parser that works on a java.io.InputStream

Allows you to look up individual bytes by index, take slices of byte ranges or strings, and drop old portions of buffered data once you are certain you no longer need them.

The buffer size is managed by allowing it to grow in size until it exceeds its capacity. When that happens, one of two things happen:

- If the buffer has enough space, we left-shift the data in the buffer to over-write the portion that has already been dropped.

- If the buffer does not have enough space, we allocate a new buffer big enough to hold the new data we need to store (size a power of two multiple of the old size) and copy the data over, again shifted left .

Linear Supertypes
BufferingByteParser, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BufferingInputStreamParser
  2. BufferingByteParser
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def inputStream: InputStream
  2. abstract def maxBufferStartSize: Int
  3. abstract def minBufferStartSize: Int

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def appendBytesToBuilder(bytes: ByteBuilder, bytesStart: Int, bytesLength: Int): Unit
    Definition Classes
    BufferingByteParser
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. def dropBufferUntil(i: Int): Unit
    Definition Classes
    BufferingByteParser
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  11. def getBuffer: Array[Byte]
    Definition Classes
    BufferingByteParser
  12. def getBufferCopyCount(): Int
    Definition Classes
    BufferingByteParser
  13. def getBufferGrowCount(): Int
    Definition Classes
    BufferingByteParser
  14. def getBufferLength(): Int
    Definition Classes
    BufferingByteParser
  15. def getByteSafe(i: Int): Byte
    Definition Classes
    BufferingByteParser
  16. def getByteUnsafe(i: Int): Byte
    Definition Classes
    BufferingByteParser
  17. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def getFirstIdx: Int
    Definition Classes
    BufferingByteParser
  19. def getLastIdx: Int
    Definition Classes
    BufferingByteParser
  20. def growBuffer(until: Int): Unit

    Copies the non-dropped Bytes in the current buffer to the start of either the current buffer, or a newly-allocated larger buffer if necessary.

    Copies the non-dropped Bytes in the current buffer to the start of either the current buffer, or a newly-allocated larger buffer if necessary.

    Definition Classes
    BufferingByteParser
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. def readDataIntoBuffer(buffer: Array[Byte], bufferOffset: Int): (Array[Byte], Boolean, Int)
  27. def requestUntil(until: Int): Boolean

    Used to ensure that byteents up to until are available to read; returns whether or not we have read off the end of the input.

    Used to ensure that byteents up to until are available to read; returns whether or not we have read off the end of the input.

    In the fast path, when until is less than the lastIdx we have buffered, there is no work to do and we return false.

    In the slow path, when until is more than lastIdx, we then run growBuffer to grow the buffer if necessary, and then readDataIntoBuffer to populate it. readDataIntoBuffer returns a newDone value to indicate whether we have read off the end of the input or not.

    Note that for some subclasses, growBuffer may be a no-op when we already know we have reached the end of input.

    Attributes
    protected
    Definition Classes
    BufferingByteParser
  28. def requestUntilGetSafeIndex(until: Int): Int

    Used to ask for data up to a certain index, as a best effort (unlike requestUntil), returning the "safe index" which it was actually able to fetch data for.

    Used to ask for data up to a certain index, as a best effort (unlike requestUntil), returning the "safe index" which it was actually able to fetch data for. This is used so the caller can use the safe index to know how far it is able to run getByteUnsafe calls without further checks, improving performance over calling getByteSafe every time which performs additional checks and logic

    Attributes
    protected
    Definition Classes
    BufferingByteParser
  29. def sliceArr(i: Int, n: Int): (Array[Byte], Int, Int)
    Definition Classes
    BufferingByteParser
  30. def sliceString(i: Int, k: Int): String
    Definition Classes
    BufferingByteParser
  31. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  32. def toString(): String
    Definition Classes
    AnyRef → Any
  33. def unsafeCharSeqForRange(start: Int, length: Int): WrapByteArrayCharSeq
    Definition Classes
    BufferingByteParser
  34. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  36. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from BufferingByteParser

Inherited from AnyRef

Inherited from Any

Ungrouped