field.setBinaryStream(new ByteArrayInputStream(TEST_STRING_SHORT.getBytes())); String fromStream = new String(readInputStream(field.getBinaryStream())); assertTrue("ASCII stream values test failure", TEST_STRING_SHORT.equals(fromStream.trim())); try { field.setBinaryStream(new ByteArrayInputStream(TEST_STRING_LONG.getBytes())); assertTrue("Should fail when the sting is longer than available space", false); } catch(SQLException sqlex) {  } }
byte[] bytes = TEST_STRING_SHORT.getBytes(); field.setBinaryStream(new ByteArrayInputStream(bytes), bytes.length); String fromStream = new String(readInputStream(field.getBinaryStream())); assertTrue("ASCII stream values test failure", TEST_STRING_SHORT.equals(fromStream.trim())); try { bytes = TEST_STRING_LONG.getBytes(); field.setBinaryStream(new ByteArrayInputStream(bytes), bytes.length); assertTrue("Should fail when the sting is longer than available space", false); } catch(SQLException sqlex) {  } }
	public void testBinaryStream() throws java.sql.SQLException {		field.setBinaryStream(new ByteArrayInputStream(TEST_STRING_SHORT.getBytes()));		String fromStream = new String(readInputStream(field.getBinaryStream()));		assertTrue("ASCII stream values test failure",			TEST_STRING_SHORT.equals(fromStream.trim()));		try {			field.setBinaryStream(new ByteArrayInputStream(TEST_STRING_LONG.getBytes()));			assertTrue("Should fail when the sting is longer than available space", false);		} catch(SQLException sqlex) {			// everything is ok		}	}