This repository has been archived by the owner. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 'Input buffer overrun' exception on static files larger than 128KB
- Loading branch information
Showing
6 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
effect/src/test/scala/korolev/effect/io/LazyBytesSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package korolev.effect.io | ||
|
||
import java.io.ByteArrayInputStream | ||
|
||
import org.scalatest.{AsyncFlatSpec, Matchers} | ||
|
||
class LazyBytesSpec extends AsyncFlatSpec with Matchers { | ||
|
||
final val inputStream1Length = 239978 | ||
final val inputStream1 = new ByteArrayInputStream(Array.fill[Byte](inputStream1Length)(1)) | ||
|
||
"LazyBytes.fromInputStream" should "return exactly same bytes as contains in InputStream" in { | ||
LazyBytes.fromInputStream(inputStream1).flatMap(_.toStrict).map { bytes => | ||
bytes.length shouldEqual inputStream1Length | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters