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