Skip to content

Commit 17a88b3

Browse files
committed
Add toString() method useful for debugging.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1378947 13f79535-47bb-0310-9956-ffa450edef68
1 parent b29483f commit 17a88b3

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/main/java/org/apache/commons/codec/binary/BaseNCodec.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,18 @@ static class Context {
8989

9090
Context() {
9191
}
92+
93+
/**
94+
* Returns a String useful for debugging (especially within a debugger.)
95+
*
96+
* @return a String useful for debugging.
97+
*/
98+
public String toString() {
99+
return String
100+
.format("%s[buffer=%s, currentLinePos=%s, eof=%s, ibitWorkArea=%s, lbitWorkArea=%s, modulus=%s, pos=%s, readPos=%s]",
101+
this.getClass().getSimpleName(), buffer, currentLinePos, eof, ibitWorkArea, lbitWorkArea,
102+
modulus, pos, readPos);
103+
}
92104
}
93105

94106
/**

0 commit comments

Comments
 (0)