View Javadoc
1   package com.opencsv;
2   /*
3    Copyright 2005 Bytecode Pty Ltd.
4   
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8   
9    http://www.apache.org/licenses/LICENSE-2.0
10  
11   Unless required by applicable law or agreed to in writing, software
12   distributed under the License is distributed on an "AS IS" BASIS,
13   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   See the License for the specific language governing permissions and
15   limitations under the License.
16   */
17  
18  import java.io.*;
19  import java.sql.Clob;
20  
21  public class MockClob implements Clob {
22  
23     private final String clobValue;
24  
25     public MockClob(String value) {
26        clobValue = value;
27     }
28  
29     @Override
30     public long length() {
31        return 0;
32     }
33  
34     @Override
35     public String getSubString(long l, int i) {
36        return null;
37     }
38  
39     @Override
40     public Reader getCharacterStream() {
41        return new StringReader(clobValue);
42     }
43  
44     @Override
45     public InputStream getAsciiStream() {
46        return null;
47     }
48  
49     @Override
50     public long position(String s, long l) {
51        return 0;
52     }
53  
54     @Override
55     public long position(Clob clob, long l) {
56        return 0;
57     }
58  
59     @Override
60     public int setString(long l, String s) {
61        return 0;
62     }
63  
64     @Override
65     public int setString(long l, String s, int i, int i1) {
66        return 0;
67     }
68  
69     @Override
70     public OutputStream setAsciiStream(long l) {
71        return null;
72     }
73  
74     @Override
75     public Writer setCharacterStream(long l) {
76        return null;
77     }
78  
79     @Override
80     public void truncate(long l) {
81  
82     }
83  
84     @Override
85     public void free() {
86  
87     }
88  
89     @Override
90     public Reader getCharacterStream(long l, long l1) {
91        return null;
92     }
93  }