|
1 |
| package com.agical.rdoc.core.converter.impl; |
|
2 |
| |
|
3 |
| import java.io.IOException; |
|
4 |
| import java.io.OutputStream; |
|
5 |
| |
|
6 |
| import com.agical.rdoc.core.converter.ObjectConverter; |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| public class StringObjectConverter implements ObjectConverter { |
|
14 |
| |
|
15 |
| private final String encoding; |
|
16 |
| |
|
17 |
1
| public StringObjectConverter(String encoding) {
|
|
18 |
1
| super();
|
|
19 |
1
| this.encoding = encoding;
|
|
20 |
| } |
|
21 |
| |
|
22 |
1
| public void convert(Object object, OutputStream target) throws IOException {
|
|
23 |
1
| target.write( ("" + object).getBytes( encoding ) );
|
|
24 |
1
| target.flush();
|
|
25 |
| } |
|
26 |
| |
|
27 |
| } |