Skip to content

Commit

Permalink
fix indent for TCArray
Browse files Browse the repository at this point in the history
  • Loading branch information
phith0n committed Mar 23, 2022
1 parent 3edb228 commit 9deadf4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions serz/tc_array.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/hex"
"fmt"
"github.com/phith0n/zkar/commons"
"io"
"strings"
)

Expand Down Expand Up @@ -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()
}

Expand All @@ -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) {
Expand Down

0 comments on commit 9deadf4

Please sign in to comment.