@Override public int read() throws IOException { while (pos >= baos.getCount()) { if (!reader.hasNext()) { return -1; } if (baos.getCount() > BUFFER_SIZE) { baos.setCount(0); pos = 0; } try { XMLEvent event = reader.nextEvent(); writer.add(event); writer.flush(); } catch (XMLStreamException e) { throw new IOException(e); } } return 0xff & baos.getBuffer()[pos++]; }
public synchronized Object sealObject(Object object) throws CryptoException { try { if (useSealedObject) { return new SealedObject((Serializable)object, encryptCipher); } AccessibleByteArrayOutputStream baos = new AccessibleByteArrayOutputStream(1 << 13); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(object); oos.flush(); oos.close(); return encrypt(baos.getBuffer(), 0, baos.getCount()); } catch ( Exception e ) { try { initEncryptCipher(); } catch (CryptoException err) { //shouldn't happen } throw new CryptoException(CorePlugin.Event.TEIID10013, CorePlugin.Util.gs(CorePlugin.Event.TEIID10013, e.getMessage())); } }
public synchronized Object sealObject(Object object) throws CryptoException { try { if (useSealedObject) { return new SealedObject((Serializable)object, encryptCipher); } AccessibleByteArrayOutputStream baos = new AccessibleByteArrayOutputStream(1 << 13); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(object); oos.flush(); oos.close(); return encrypt(baos.getBuffer(), 0, baos.getCount()); } catch ( Exception e ) { try { initEncryptCipher(); } catch (CryptoException err) { //shouldn't happen } throw new CryptoException(CorePlugin.Event.TEIID10013, CorePlugin.Util.gs(CorePlugin.Event.TEIID10013, e.getMessage())); } }
oos.writeObject(functions); oos.close(); ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.getBuffer(), 0, baos.getCount())); functions = (List<FunctionMethod>) ois.readObject(); for (FunctionMethod functionMethod : functions) {
oos.writeObject(functions); oos.close(); ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.getBuffer(), 0, baos.getCount())); functions = (List<FunctionMethod>) ois.readObject(); for (FunctionMethod functionMethod : functions) {
oos.writeObject(functions); oos.close(); ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.getBuffer(), 0, baos.getCount())); functions = (List<FunctionMethod>) ois.readObject(); for (FunctionMethod functionMethod : functions) {