Skip to content

Commit 25a4f07

Browse files
authored
Merge pull request #84 from Charles-Wu-Chen/base64_support_filebox
Base64 support filebox related to issue #83
2 parents 0aea528 + 63f5d8d commit 25a4f07

File tree

1 file changed

+5
-4
lines changed
  • wechaty-puppet/src/main/kotlin/io/github/wechaty/filebox

1 file changed

+5
-4
lines changed

Diff for: wechaty-puppet/src/main/kotlin/io/github/wechaty/filebox/FileBox.kt

+5-4
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@ class FileBox(options: FileBoxOptions) {
138138
}
139139

140140
fun toJsonString(): String {
141-
buffer = toByte(this)
141+
buffer = getBufferByte(this)
142142

143143
return JsonUtils.write(this)
144144

145145
}
146146

147-
fun toByte(fileBox: FileBox): ByteArray? {
147+
private fun getBufferByte(fileBox: FileBox): ByteArray? {
148148
when (fileBox.type()) {
149149
FileBoxType.File -> {
150150

@@ -153,11 +153,12 @@ class FileBox(options: FileBoxOptions) {
153153
return FileUtils.readFileToByteArray(file)
154154

155155
}
156-
157156
FileBoxType.Url -> {
158157
return null;
159158
}
160-
159+
FileBoxType.Base64 -> {
160+
return null;
161+
}
161162
else -> {
162163
TODO()
163164
}

0 commit comments

Comments
 (0)