Created
June 27, 2015 16:56
-
-
Save ponkotuy/5ad9559cbbe0fa5a4778 to your computer and use it in GitHub Desktop.
jpexsのffdecからFlashのimageを取ってくるScala Sample
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
import java.io._ | |
import com.jpexs.decompiler.flash.SWF | |
object Main { | |
def main(args: Array[String]) { | |
val path = "/home/yosuke/01_01.swf" | |
val is = new FileInputStream(new File(path)) | |
val swf = new SWF(is, path, "KanColle1_1", false) | |
val img = swf.getImage(1).getImageData | |
val os = new FileOutputStream("/home/yosuke/01_01.png") | |
output(img, os) | |
} | |
val BufSize = 1024 * 4 | |
def output(is: InputStream, os: OutputStream): Unit = { | |
val buf = new Array[Byte](BufSize) | |
while(is.read(buf) >= 0) { | |
os.write(buf) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment