703704705706707708709710711
baos.write(buffer, 0, read); } is.close(); } catch (Exception e) { throw new SystemUncheckedException(e.getMessage(), e); } return baos.toByteArray(); }
718719720721722723724725
*/ public static InputStream toInputStream(byte[] bytes) { try { return new ByteArrayInputStream(bytes); } catch (Exception e) { throw new SystemUncheckedException(e.getMessage(), e); } }
732733734735736737738739
*/ public static Reader toReader(String str) { try { return new InputStreamReader(toInputStream(str.getBytes())); } catch (Exception e) { throw new SystemUncheckedException(e.getMessage(), e); } }
754755756757758759760761762
byte[] bytes; try { bytes = toBytes(new FileInputStream(file)); } catch (Exception e) { throw new SystemUncheckedException(e.getMessage(), e); } return bytes; }
780781782783784785786787
os.close(); return f; } catch (IOException e) { throw new SystemUncheckedException(e.getMessage(), e); } }
804805806807808809810811