package io
- Alphabetic
- By Inheritance
- io
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
final
case class
Packet
(remote: InetSocketAddress, bytes: Chunk[Byte]) extends Product with Serializable
A single packet to send to the specified remote address or received from the specified address.
A single packet to send to the specified remote address or received from the specified address.
- remote
remote party to send/receive packet to/from
- bytes
data to send/receive
Value Members
-
def
readInputStream[F[_]](fis: F[InputStream], chunkSize: Int, closeAfterUse: Boolean = true)(implicit arg0: Sync[F]): Stream[F, Byte]
Reads all bytes from the specified
InputStream
with a buffer size ofchunkSize
.Reads all bytes from the specified
InputStream
with a buffer size ofchunkSize
. SetcloseAfterUse
to false if theInputStream
should not be closed after use.Blocks the current thread.
-
def
readInputStreamAsync[F[_]](fis: F[InputStream], chunkSize: Int, closeAfterUse: Boolean = true)(implicit F: Effect[F], ec: ExecutionContext): Stream[F, Byte]
Reads all bytes from the specified
InputStream
with a buffer size ofchunkSize
.Reads all bytes from the specified
InputStream
with a buffer size ofchunkSize
. SetcloseAfterUse
to false if theInputStream
should not be closed after use.This will block a thread in the
ExecutionContext
, so the size of any associated threadpool should be sized appropriately. -
def
stdin[F[_]](bufSize: Int)(implicit F: Sync[F]): Stream[F, Byte]
Stream of bytes read from standard input.
-
def
stdinAsync[F[_]](bufSize: Int)(implicit F: Effect[F], ec: ExecutionContext): Stream[F, Byte]
Stream of bytes read asynchronously from standard input.
-
def
stdout[F[_]](implicit F: Sync[F]): Sink[F, Byte]
Sink of bytes that writes emitted values to standard output.
-
def
stdoutAsync[F[_]](implicit F: Effect[F], ec: ExecutionContext): Sink[F, Byte]
Sink of bytes that writes emitted values to standard output asynchronously.
-
def
toInputStream[F[_]](implicit F: Effect[F], ec: ExecutionContext): Pipe[F, Byte, InputStream]
Pipe that converts a stream of bytes to a stream that will emits a single
java.io.InputStream
, that is closed whenever the resulting stream terminates.Pipe that converts a stream of bytes to a stream that will emits a single
java.io.InputStream
, that is closed whenever the resulting stream terminates.If the
close
of resulting input stream is invoked manually, then this will await until the original stream completely terminates.Because all
InputStream
methods block (includingclose
), the resultingInputStream
should be consumed on a different thread pool than the one that is backing theExecutionContext
.Note that the implementation is not thread safe -- only one thread is allowed at any time to operate on the resulting
java.io.InputStream
. -
def
writeOutputStream[F[_]](fos: F[OutputStream], closeAfterUse: Boolean = true)(implicit arg0: Sync[F]): Sink[F, Byte]
Writes all bytes to the specified
OutputStream
.Writes all bytes to the specified
OutputStream
. SetcloseAfterUse
to false if theOutputStream
should not be closed after use.Blocks the current thread.
-
def
writeOutputStreamAsync[F[_]](fos: F[OutputStream], closeAfterUse: Boolean = true)(implicit F: Effect[F], ec: ExecutionContext): Sink[F, Byte]
Writes all bytes to the specified
OutputStream
.Writes all bytes to the specified
OutputStream
. SetcloseAfterUse
to false if theOutputStream
should not be closed after use.This will block a thread in the
ExecutorService
, so the size of any associated threadpool should be sized appropriately.