Here you can find the source of getAsciiStream(Object value, int columnType)
public static java.io.InputStream getAsciiStream(Object value, int columnType) throws Exception
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static java.io.InputStream getAsciiStream(Object value, int columnType) throws Exception { InputStream asciiStream = null; // check for NULL if (value == null) { return null; }/*from ww w . j ava 2s . co m*/ try { if (isString(columnType)) { asciiStream = new ByteArrayInputStream(((String) value).getBytes("ASCII")); } else { throw new Exception( "asciiStream conversion failed. (" + value.toString().trim() + "/" + columnType + ")"); } } catch (java.io.UnsupportedEncodingException ex) { throw new Exception( "asciiStream conversion failed. (" + value.toString().trim() + "/" + columnType + ")"); } return (java.io.InputStream) asciiStream; } public static boolean isString(int dataType) { switch (dataType) { case java.sql.Types.CHAR: case java.sql.Types.VARCHAR: case java.sql.Types.LONGVARCHAR: case java.sql.Types.NCHAR: case java.sql.Types.NVARCHAR: case java.sql.Types.LONGNVARCHAR: return true; default: return false; } } public static byte[] getBytes(Object value, int columnType) throws Exception { return (byte[]) (value); } }