trait Writable extends Any
A Writable is a source of bytes that can be written to an OutputStream.
Essentially a push-based version of java.io.InputStream
, that allows an
implementation to guarantee that cleanup logic runs after the bytes are
written.
Writable is also much easier to implement than java.io.InputStream
: any
code that previously wrote output to an ByteArrayOutputStream
or
StringBuilder
can trivially satisfy the Writable interface. That makes
Writable very convenient to use for allowing zero-friction zero-overhead
streaming data exchange between different libraries.
Writable comes with implicit constructors from Array[Byte]
, String
and InputStream
, and is itself a tiny interface with minimal functionality.
Libraries using Writable are expected to extend it to provide additional
methods or additional implicit constructors that make sense in their context.
- Alphabetic
- By Inheritance
- Writable
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def contentLength: Option[Long]
-
def
equals(arg0: Any): Boolean
- Definition Classes
- Any
-
def
hashCode(): Int
- Definition Classes
- Any
- def httpContentType: Option[String]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
toString(): String
- Definition Classes
- Any