@Override public InputStream getInputStream() throws IOException { try { return new ReaderInputStream(getReader(clob.getCharacterStream()), charset); } catch (SQLException e) { throw new IOException(e); } }
@Override public int read() throws IOException { int read = read(singleByte, 0, 1); if (read == 1) { return singleByte[0] & 0xff; } assert read != 0; return -1; }
checkResult(cr); if (read == -1 && !wasOverflow) { cr = encoder.flush(bb); checkResult(cr); if (!wasOverflow) { done = true;
public InputStream getBinaryStream() throws SQLException { ReaderInputStream ris = new ReaderInputStream(searchstr.getCharacterStream(), Charset.forName("UTF-16")); //$NON-NLS-1$ try { ris.skip(2); return ris; } catch (IOException e) { throw new SQLException(e); } } }
@Test public void testUTF8() throws Exception { FileInputStream fis = new FileInputStream(UnitTestUtil.getTestDataFile("legal_notice.xml")); //$NON-NLS-1$ ReaderInputStream ris = new ReaderInputStream(new FileReader(UnitTestUtil.getTestDataFile("legal_notice.xml")), Charset.forName("UTF-8")); //$NON-NLS-1$ //$NON-NLS-2$ int value; while (true) { value = fis.read(); assertEquals(value, ris.read()); if (value == -1) { break; } } }
public InputStream getBinaryStream() throws SQLException { ReaderInputStream ris = new ReaderInputStream(searchstr.getCharacterStream(), Charset.forName("UTF-16")); //$NON-NLS-1$ try { ris.skip(2); return ris; } catch (IOException e) { throw new SQLException(e); } } }
public InputStream getInputStream() throws IOException { try { return new ReaderInputStream(sqlxml.getCharacterStream(), encoding); } catch (SQLException e) { throw new IOException(e); } } };
@Override public int read() throws IOException { int read = read(singleByte, 0, 1); if (read == 1) { return singleByte[0] & 0xff; } assert read != 0; return -1; }
checkResult(cr); if (read == -1 && !wasOverflow) { cr = encoder.flush(bb); checkResult(cr); if (!wasOverflow) { done = true;
/** * Gets the <code>CLOB</code> value designated by this <code>Clob</code> * object as a stream of Ascii bytes. * @return an ascii stream containing the <code>CLOB</code> data * @exception SQLException if there is an error accessing the * <code>CLOB</code> value */ public InputStream getAsciiStream() throws SQLException { return new ReaderInputStream(getCharacterStream(), Charset.forName("US-ASCII")); //$NON-NLS-1$ }
/** * Gets the <code>CLOB</code> value designated by this <code>Clob</code> * object as a stream of Ascii bytes. * @return an ascii stream containing the <code>CLOB</code> data * @exception SQLException if there is an error accessing the * <code>CLOB</code> value */ public InputStream getAsciiStream() throws SQLException { return new ReaderInputStream(getCharacterStream(), Charset.forName("US-ASCII")); //$NON-NLS-1$ }
public InputStream getInputStream() throws IOException { try { return new ReaderInputStream(sqlxml.getCharacterStream(), encoding); } catch (SQLException e) { throw new IOException(e); } } };
public InputStream getInputStream() throws IOException { try { return new ReaderInputStream(sqlxml.getCharacterStream(), encoding); } catch (SQLException e) { throw new IOException(e); } } };
@Override public InputStream getInputStream() throws IOException { try { return new ReaderInputStream(getReader(clob.getCharacterStream()), charset); } catch (SQLException e) { throw new IOException(e); } }
static final InputStream getAsciiStream(Object value) throws SQLException { if (value == null) { return null; } if (value instanceof Clob) { return ((Clob) value).getAsciiStream(); } if (value instanceof SQLXML) { //TODO: could check the SQLXML encoding return new ReaderInputStream(((SQLXML)value).getCharacterStream(), Charset.forName("ASCII")); //$NON-NLS-1$ } return new ByteArrayInputStream(getString(value).getBytes(Charset.forName("ASCII"))); //$NON-NLS-1$ }
static final InputStream getAsciiStream(Object value) throws SQLException { if (value == null) { return null; } if (value instanceof Clob) { return ((Clob) value).getAsciiStream(); } if (value instanceof SQLXML) { //TODO: could check the SQLXML encoding return new ReaderInputStream(((SQLXML)value).getCharacterStream(), Charset.forName("ASCII")); //$NON-NLS-1$ } return new ByteArrayInputStream(getString(value).getBytes(Charset.forName("ASCII"))); //$NON-NLS-1$ }
@Override public InputStream getInputStream() throws IOException { return new ReaderInputStream(new StringReader("Clob contents"), Charset.forName(Streamable.ENCODING)); //$NON-NLS-1$ }
@Override public InputStream getInputStream() throws IOException { return new ReaderInputStream(new StringReader("Clob contents One"), Charset.forName(Streamable.ENCODING)); }
@Override public InputStream getInputStream() throws IOException { return new ReaderInputStream(new StringReader("Blob contents Two"), Charset.forName(Streamable.ENCODING)); }
@Override public InputStream getInputStream() throws IOException { return new ReaderInputStream(new StringReader("small"), Charset.forName(Streamable.ENCODING)); }