New J2K: Split old j2k and new j2k tests
This commit is contained in:
committed by
Ilya Kirillov
parent
02a206bf7c
commit
b411e8e18e
@@ -1,13 +0,0 @@
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.IOException
|
||||
|
||||
class C {
|
||||
@Throws(IOException::class)
|
||||
internal fun foo() {
|
||||
ByteArrayInputStream(ByteArray(10)).use { stream ->
|
||||
// reading something
|
||||
val c = stream.read()
|
||||
println(c)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.IOException
|
||||
|
||||
class C {
|
||||
@Throws(IOException::class)
|
||||
internal fun foo() {
|
||||
ByteArrayInputStream(ByteArray(10)).use { input ->
|
||||
ByteArrayOutputStream().use { output ->
|
||||
output.write(input.read())
|
||||
output.write(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.IOException
|
||||
|
||||
class C {
|
||||
@Throws(IOException::class)
|
||||
internal fun foo() {
|
||||
ByteArrayInputStream(ByteArray(10)).use { stream ->
|
||||
println(stream.read())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.IOException
|
||||
|
||||
class C {
|
||||
internal fun foo() {
|
||||
try {
|
||||
ByteArrayInputStream(ByteArray(10)).use { stream ->
|
||||
// reading something
|
||||
val c = stream.read()
|
||||
println(c)
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
println(e)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.IOException
|
||||
|
||||
class C {
|
||||
internal fun foo() {
|
||||
try {
|
||||
ByteArrayInputStream(ByteArray(10)).use { stream ->
|
||||
// reading something
|
||||
val c = stream.read()
|
||||
println(c)
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
println(e)
|
||||
} finally {
|
||||
println("Finally!")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.IOException
|
||||
|
||||
class C {
|
||||
internal fun foo() {
|
||||
try {
|
||||
ByteArrayInputStream(ByteArray(10)).use { stream ->
|
||||
// reading something
|
||||
val c = stream.read()
|
||||
println(c)
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
println(e)
|
||||
} catch (e: Exception) {
|
||||
System.err.println(e)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.IOException
|
||||
|
||||
class C {
|
||||
@Throws(IOException::class)
|
||||
internal fun foo() {
|
||||
try {
|
||||
ByteArrayInputStream(ByteArray(10)).use { stream ->
|
||||
// reading something
|
||||
val c = stream.read()
|
||||
println(c)
|
||||
}
|
||||
} finally {
|
||||
// dispose something else
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.IOException
|
||||
|
||||
class C {
|
||||
internal fun foo(): Int {
|
||||
try {
|
||||
ByteArrayInputStream(ByteArray(10)).use { stream ->
|
||||
// reading something
|
||||
return stream.read()
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
println(e)
|
||||
return -1
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
import java.io.*
|
||||
|
||||
internal interface I {
|
||||
@Throws(IOException::class)
|
||||
fun doIt(stream: InputStream): Int
|
||||
}
|
||||
|
||||
class C {
|
||||
@Throws(IOException::class)
|
||||
internal fun foo() {
|
||||
ByteArrayInputStream(ByteArray(10)).use { stream ->
|
||||
bar(object : I {
|
||||
@Throws(IOException::class)
|
||||
override fun doIt(stream: InputStream): Int {
|
||||
return stream.available()
|
||||
}
|
||||
}, stream)
|
||||
}
|
||||
}
|
||||
|
||||
@Throws(IOException::class)
|
||||
internal fun bar(i: I, stream: InputStream): Int {
|
||||
return i.doIt(stream)
|
||||
}
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
import java.io.*
|
||||
|
||||
internal interface I {
|
||||
@Throws(IOException::class)
|
||||
fun doIt(stream: InputStream): Int
|
||||
}
|
||||
|
||||
class C {
|
||||
@Throws(IOException::class)
|
||||
internal fun foo(): Int {
|
||||
ByteArrayInputStream(ByteArray(10)).use { stream ->
|
||||
return bar(object : I {
|
||||
@Throws(IOException::class)
|
||||
override fun doIt(stream: InputStream): Int {
|
||||
return stream.available()
|
||||
}
|
||||
}, stream)
|
||||
}
|
||||
}
|
||||
|
||||
@Throws(IOException::class)
|
||||
internal fun bar(i: I, stream: InputStream): Int {
|
||||
return i.doIt(stream)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user