abstract class Codec extends AnyRef

Source
Codec.scala
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Codec
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Codec()

Abstract Value Members

  1. abstract def compress(bytes: ByteString): ByteString
  2. abstract val name: String
  3. abstract def uncompress(compressedBitSet: Boolean, bytes: ByteString): ByteString

    Process the given frame bytes, uncompress if the compression bit is set.

    Process the given frame bytes, uncompress if the compression bit is set. Identity codec will fail with a io.grpc.StatusException if the compressedBit is set.

    Places no bound on the decompressed size; prefer uncompress(compressedBitSet, bytes, maxDecompressedSize).

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) Use uncompress(compressedBitSet, bytes, maxDecompressedSize), which bounds the decompressed size

  4. abstract def uncompress(bytes: ByteString): ByteString

    Decompress the given bytes with no bound on the output size.

    Decompress the given bytes with no bound on the output size.

    A compressed frame can inflate to arbitrarily many bytes, so a caller that does not impose a limit is exposed to a decompression bomb. Prefer uncompress(bytes, maxDecompressedSize), which fails with RESOURCE_EXHAUSTED instead of allocating without bound.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) Use uncompress(bytes, maxDecompressedSize), which bounds the decompressed size

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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  10. def isCompressed: Boolean
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  15. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. def uncompress(compressedBitSet: Boolean, bytes: ByteString, maxDecompressedSize: Int): ByteString

    Process the given frame bytes, uncompress if the compression bit is set, enforcing a maximum decompressed size.

    Process the given frame bytes, uncompress if the compression bit is set, enforcing a maximum decompressed size.

    Delegates to uncompress(bytes, maxDecompressedSize) so that codecs which can enforce the limit while decompressing (rather than after) get the chance to fail fast.

    compressedBitSet

    whether the compression bit is set

    bytes

    the frame bytes

    maxDecompressedSize

    the maximum allowed decompressed size in bytes

  18. def uncompress(bytes: ByteString, maxDecompressedSize: Int): ByteString

    Decompress the given bytes, enforcing a maximum decompressed size.

    Decompress the given bytes, enforcing a maximum decompressed size. Throws a StatusException with RESOURCE_EXHAUSTED if the decompressed output exceeds maxDecompressedSize.

    This default implementation decompresses in full and checks afterwards, so it bounds what a caller receives but not what is allocated along the way. Codecs that can enforce the limit while decompressing should override it; Gzip does.

    bytes

    the compressed bytes

    maxDecompressedSize

    the maximum allowed decompressed size in bytes

    Annotations
    @nowarn()
  19. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  20. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped