From 334064326621492e2c3237b9614d314b7d720d70 Mon Sep 17 00:00:00 2001 From: REAndroid <94234159+REAndroid@users.noreply.github.com> Date: Tue, 16 Nov 2021 02:04:50 +0800 Subject: [PATCH] Update README.md --- README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ab043b..8f5a1d7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,28 @@ # ARSCLib -Android binary resources read/write library +## Android binary resources read/write library + +```java + import com.reandroid.lib.arsc.chunk.TableBlock; + import com.reandroid.lib.arsc.io.BlockReader; + + public static void example() throws IOException { + File inFile=new File("resources.arsc"); + BlockReader blockReader=new BlockReader(inFile); + + TableBlock tableBlock=new TableBlock(); + tableBlock.readBytes(blockReader); + + // edit tableBlock as desired + + tableBlock.refresh(); + + File outFile=new File("resources_out.arsc"); + OutputStream outputStream=new FileOutputStream(outFile, false); + + tableBlock.writeBytes(outputStream); + + outputStream.flush(); + outputStream.close(); + } + +```