Skip to content

Commit

Permalink
Added reader method that accepts ByteArray
Browse files Browse the repository at this point in the history
  • Loading branch information
sksamuel committed Apr 15, 2024
1 parent 680a01b commit cce1d25
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 64 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@ class AvroBinaryReaderFactory(schema: Schema, private val factory: DecoderFactor
* This variant is much slower than using a byte array. If you already have
* the bytes available, that should be preferred.
*/
fun writer(input: InputStream): AvroBinaryReader {
fun reader(input: InputStream): AvroBinaryReader {
return AvroBinaryReader(datumReader, input, null, factory)
}

/**
* Creates an [AvroBinaryReader] that reads from the given [ByteArray].
*/
fun reader(bytes: ByteArray): AvroBinaryReader {
return AvroBinaryReader(datumReader, null, bytes, factory)
}
}

/**
Expand Down

0 comments on commit cce1d25

Please sign in to comment.