Skip to content

Commit 952e51b

Browse files
committed
Add "charset" accessor to Decoder.
1 parent 64f0148 commit 952e51b

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

httprpc-client/src/main/java/org/httprpc/io/Decoder.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ protected Decoder(Charset charset) {
4040
this.charset = charset;
4141
}
4242

43+
/**
44+
* Returns the character set to use when decoding an input stream.
45+
*
46+
* @return
47+
* The input stream's character set.
48+
*/
49+
public Charset getCharset() {
50+
return charset;
51+
}
52+
4353
/**
4454
* Reads a value from an input stream.
4555
*

httprpc-client/src/main/java/org/httprpc/io/Encoder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public abstract class Encoder<T> {
3333
* Constructs a new encoder.
3434
*
3535
* @param charset
36-
* The character encoding to use when encoding an output stream.
36+
* The character set to use when encoding an output stream.
3737
*/
3838
protected Encoder(Charset charset) {
3939
if (charset == null) {
@@ -44,10 +44,10 @@ protected Encoder(Charset charset) {
4444
}
4545

4646
/**
47-
* Returns the character encoding used by the encoder.
47+
* Returns the character set to use when encoding an output stream.
4848
*
4949
* @return
50-
* The character encoding.
50+
* The output stream's character set.
5151
*/
5252
public Charset getCharset() {
5353
return charset;

0 commit comments

Comments
 (0)