Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.squareup.wire

import kotlin.Throws
import okio.Closeable
import okio.IOException

/**
Expand All @@ -39,8 +40,11 @@ import okio.IOException
* You should ensure that such backpressure propagates to the originator of outbound messages.
*
* Instances of this interface are not safe for concurrent use.
*
* Closing a sink will terminate the stream and release its resources. If this has not been canceled
* this signals a normal completion of the stream.
*/
expect interface MessageSink<in T : Any> {
interface MessageSink<in T : Any> : Closeable {
/**
* Encode [message] to bytes and enqueue the bytes for delivery, waiting if necessary until the
* delivery channel has capacity for the encoded message.
Expand All @@ -60,11 +64,4 @@ expect interface MessageSink<in T : Any> {
*/
@Throws(IOException::class)
fun cancel()

/**
* Terminate the stream and release its resources. If this has not been canceled this signals a
* normal completion of the stream.
*/
@Throws(IOException::class)
fun close()
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.squareup.wire

import kotlin.Throws
import okio.Closeable
import okio.IOException

/**
Expand All @@ -35,7 +36,7 @@ import okio.IOException
*
* Instances of this interface are not safe for concurrent use.
*/
expect interface MessageSource<out T : Any> {
interface MessageSource<out T : Any> : Closeable {
/**
* Read the next length-prefixed message on the stream and return it. Returns null if there are
* no further messages on this stream.
Expand All @@ -45,7 +46,4 @@ expect interface MessageSource<out T : Any> {
*/
@Throws(IOException::class)
fun read(): T?

@Throws(IOException::class)
fun close()
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package com.squareup.wire

import com.squareup.wire.internal.identityOrNull
import java.io.IOException
import kotlin.reflect.KClass
import okio.IOException

/**
* An abstract [ProtoAdapter] that converts values of an enum to and from integers.
Expand Down
27 changes: 0 additions & 27 deletions wire-runtime/src/jvmMain/kotlin/com/squareup/wire/MessageSink.kt

This file was deleted.

24 changes: 0 additions & 24 deletions wire-runtime/src/jvmMain/kotlin/com/squareup/wire/MessageSource.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
package com.squareup.wire

import com.squareup.wire.internal.createRuntimeMessageAdapter
import java.io.IOException
import java.io.InputStream
import java.io.OutputStream
import kotlin.reflect.KClass
import okio.BufferedSink
import okio.BufferedSource
import okio.ByteString
import okio.IOException
import okio.buffer
import okio.sink
import okio.source
Expand Down

This file was deleted.

This file was deleted.