-
public final class DecodingKt
-
-
Method Summary
Modifier and Type Method Description final static <R extends Any> RreadDecodeOrNull(Readable $self, Function1<ByteArray, Try<R, DecodeError>> decode)final static <R extends Any, S extends Any> Try<R, DecodeError>decode(S $self, Function1<S, R> block, Function1<Exception, Error> wrapError)Decodes receiver properly wrapping exceptions into DecodeErrors. final static Try<String, DecodeError>decodeString(ByteArray $self, Charset charset)Content as plain text. final static Try<ElementNode, DecodeError>decodeXml(ByteArray $self)Content as an XML document. final static Try<JSONObject, DecodeError>decodeJson(ByteArray $self)Content parsed from JSON. final static Try<Manifest, DecodeError>decodeRwpm(ByteArray $self)Readium Web Publication Manifest parsed from the content. final static Try<Manifest, DecodeError>decodeRwpm(JSONObject $self)Readium Web Publication Manifest parsed from JSON. final static Try<Bitmap, DecodeError>decodeBitmap(ByteArray $self)Reads the full content as a Bitmap. final static <R extends Any> Try<R, ReadError>decodeOrElse(Try<ByteArray, ReadError> $self, Function1<ByteArray, Try<R, DecodeError>> decode, Function1<DecodeError.Decoding, R> recover)final static <R extends Any> RdecodeOrNull(Try<ByteArray, ReadError> $self, Function1<ByteArray, Try<R, DecodeError>> decode)final static <R extends Any> RreadDecodeOrElse(Readable $self, Function1<ByteArray, Try<R, DecodeError>> decode, Function1<ReadError, R> recoverRead, Function1<DecodeError.Decoding, R> recoverDecode)final static <R extends Any> RreadDecodeOrElse(Readable $self, Function1<ByteArray, Try<R, DecodeError>> decode, Function1<ReadError, R> recover)-
-
Method Detail
-
readDecodeOrNull
final static <R extends Any> R readDecodeOrNull(Readable $self, Function1<ByteArray, Try<R, DecodeError>> decode)
-
decode
final static <R extends Any, S extends Any> Try<R, DecodeError> decode(S $self, Function1<S, R> block, Function1<Exception, Error> wrapError)
Decodes receiver properly wrapping exceptions into DecodeErrors.
-
decodeString
final static Try<String, DecodeError> decodeString(ByteArray $self, Charset charset)
Content as plain text.
-
decodeXml
final static Try<ElementNode, DecodeError> decodeXml(ByteArray $self)
Content as an XML document.
-
decodeJson
final static Try<JSONObject, DecodeError> decodeJson(ByteArray $self)
Content parsed from JSON.
-
decodeRwpm
final static Try<Manifest, DecodeError> decodeRwpm(ByteArray $self)
Readium Web Publication Manifest parsed from the content.
-
decodeRwpm
final static Try<Manifest, DecodeError> decodeRwpm(JSONObject $self)
Readium Web Publication Manifest parsed from JSON.
-
decodeBitmap
final static Try<Bitmap, DecodeError> decodeBitmap(ByteArray $self)
Reads the full content as a Bitmap.
-
decodeOrElse
final static <R extends Any> Try<R, ReadError> decodeOrElse(Try<ByteArray, ReadError> $self, Function1<ByteArray, Try<R, DecodeError>> decode, Function1<DecodeError.Decoding, R> recover)
-
decodeOrNull
final static <R extends Any> R decodeOrNull(Try<ByteArray, ReadError> $self, Function1<ByteArray, Try<R, DecodeError>> decode)
-
readDecodeOrElse
final static <R extends Any> R readDecodeOrElse(Readable $self, Function1<ByteArray, Try<R, DecodeError>> decode, Function1<ReadError, R> recoverRead, Function1<DecodeError.Decoding, R> recoverDecode)
-
readDecodeOrElse
final static <R extends Any> R readDecodeOrElse(Readable $self, Function1<ByteArray, Try<R, DecodeError>> decode, Function1<ReadError, R> recover)
-
-
-
-