Class

com.twitter.scalding.serialization.JavaStreamEnrichments

RichInputStream

Related Doc: package JavaStreamEnrichments

Permalink

implicit final class RichInputStream extends AnyVal

This has a lot of methods from DataInputStream without having to allocate to get them This code is similar to those algorithms

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RichInputStream
  2. AnyVal
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RichInputStream(s: InputStream)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  6. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  7. def markOrBuffer(size: Int): InputStream

    Permalink

    If s supports marking, we mark it.

    If s supports marking, we mark it. Otherwise we read the needed bytes out into a ByteArrayStream and return that. This is intended for the case where you need possibly read size bytes but may stop early, then skip this exact number of bytes. Intended use is: {code} val size = 100 val marked = s.markOrBuffer(size) val y = fn(marked) marked.reset marked.skipFully(size) {/code}

  8. def readBoolean: Boolean

    Permalink
  9. def readByte: Byte

    Permalink

    Like read, but throws eof on error

  10. def readChar: Char

    Permalink
  11. def readDouble: Double

    Permalink
  12. def readFloat: Float

    Permalink
  13. final def readFully(bytes: Array[Byte], offset: Int, len: Int): Unit

    Permalink
  14. final def readFully(bytes: Array[Byte]): Unit

    Permalink
  15. def readInt: Int

    Permalink

    This is the algorithm from DataInputStream it was also benchmarked against the approach used in readLong and found to be faster

  16. def readLong: Long

    Permalink
  17. final def readPosVarInt: Int

    Permalink

    This reads a varInt encoding that only encodes non-negative numbers.

    This reads a varInt encoding that only encodes non-negative numbers. It uses: 1 byte for values 0 - 255, 3 bytes for 256 - 65535, 7 bytes for 65536 - Int.MaxValue

  18. def readShort: Short

    Permalink
  19. def readUnsignedByte: Int

    Permalink
  20. def readUnsignedShort: Int

    Permalink
  21. val s: InputStream

    Permalink
  22. final def skipFully(count: Long): Unit

    Permalink
  23. def toString(): String

    Permalink
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped