From 9deadf4e38ded22571aacf191337b0e3cad8c46c Mon Sep 17 00:00:00 2001 From: phith0n Date: Thu, 24 Mar 2022 04:18:50 +0800 Subject: [PATCH] fix indent for TCArray --- serz/tc_array.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/serz/tc_array.go b/serz/tc_array.go index 56e2b83..c4021b9 100644 --- a/serz/tc_array.go +++ b/serz/tc_array.go @@ -5,7 +5,6 @@ import ( "encoding/hex" "fmt" "github.com/phith0n/zkar/commons" - "io" "strings" ) @@ -45,7 +44,7 @@ func (t *TCArray) ToString() string { className = t.ClassPointer.Reference.NormalClassDesc.ClassName.Data } if className == "[B" { - t.DumpByteArray(b) + b.Print(t.DumpByteArray()) return b.String() } @@ -59,12 +58,14 @@ func (t *TCArray) ToString() string { return b.String() } -func (t *TCArray) DumpByteArray(b io.Writer) { - var dumper = hex.Dumper(b) +func (t *TCArray) DumpByteArray() string { + var builder = &strings.Builder{} + var dumper = hex.Dumper(builder) for _, v := range t.ArrayData { _, _ = dumper.Write([]byte{v.Byte}) } dumper.Close() + return builder.String() } func readTCArray(stream *ObjectStream) (*TCArray, error) {