Package java.io

Examples of java.io.ByteArrayInputStream


                RecordEnumeration re = rs.enumerateRecords(null, null, false);
                if (this.cc != null && re.hasNextElement()) {
                    byte[] bSource = re.nextRecord();
                    re.destroy();
                    if (bSource != null) {
                        ByteArrayInputStream bais = new ByteArrayInputStream(bSource);
                        DataInputStream dis = new DataInputStream(bais);
                        int nSource = dis.readInt();
                        int nCapture = dis.readInt();
                        this.nCurrentHeight = dis.readInt();
                        this.nCurrentWidth = dis.readInt();
View Full Code Here


        public Object objectFromByteBuffer(byte[] buf) throws Exception {
            if(buf == null)
                return null;

            DataInputStream in=new DataInputStream(new ByteArrayInputStream(buf));
            byte type=in.readByte();
            if(type == NULL)
                return null;
            if(type == METHOD_CALL) {
                short id=in.readShort();
View Full Code Here

   * @see fr.dyade.aaa.util.Transaction#load(java.lang.String, java.lang.String)
   */
  public final Object load(String dirName, String name) throws IOException, ClassNotFoundException {
    byte[] buf = loadByteArray(dirName, name);
    if (buf != null) {
      ByteArrayInputStream bis = new ByteArrayInputStream(buf);
      ObjectInputStream ois = new ObjectInputStream(bis);
      try {
        return ois.readObject();
      } finally {
        ois.close();
        bis.close();
      }
    }
   
    return null;
  }
View Full Code Here

  }
 
  public final Object load(String dirName, String name) throws IOException, ClassNotFoundException {
    byte[] buf = loadByteArray(dirName, name);
    if (buf != null) {
      ByteArrayInputStream bis = new ByteArrayInputStream(buf);
      ObjectInputStream ois = new ObjectInputStream(bis);
      try {
        return ois.readObject();
      } finally {
        ois.close();
        bis.close();
      }
    }
   
    return null;
  }
View Full Code Here

                    true);
            try {
                byte[] bSource = rs.getRecord(this.nIdSource);
                this.szCurrentSource = new String(bSource);
                bSource = rs.getRecord(this.nIdSettings);
                ByteArrayInputStream bais = new ByteArrayInputStream(bSource);
                DataInputStream dis = new DataInputStream(bais);
                dis = null;
                bais = null;
                rs.closeRecordStore();
            } catch (Exception ex) {
View Full Code Here

    if (! enabled) {
      return input;
    }

    // okay, parse the HTML code
    ByteArrayInputStream bis = new ByteArrayInputStream(input.getContent());
    Tidy tidy = new Tidy();
    tidy.setUpperCaseTags(false);
    tidy.setUpperCaseAttrs(false);
    tidy.setErrout(new PrintWriter(new NullWriter()));
View Full Code Here

            java.security.cert.CertificateFactory cf=java.security.cert.CertificateFactory.getInstance("X.509");
            for (int i=0; i<length; i++)
            {
                byte bytes[]=javaxCerts[i].getEncoded();
                ByteArrayInputStream stream=new ByteArrayInputStream(bytes);
                javaCerts[i]=(X509Certificate)cf.generateCertificate(stream);
            }

            return javaCerts;
        }
View Full Code Here

        bos.close();

        // Get the bytes of the serialized object
        final byte[] b1 = bos.toByteArray();

        ByteArrayInputStream bais = new ByteArrayInputStream( b1 );
        StatefulSession session2 = ruleBase.newStatefulSession( bais );
        bais.close();

        bos = new ByteArrayOutputStream();
        out = new ObjectOutputStream( bos );
        out.writeObject( session2 );
        out.close();
View Full Code Here

        marshaller.marshall( bos,
                             ksession );
        final byte[] b1 = bos.toByteArray();
        bos.close();

        ByteArrayInputStream bais = new ByteArrayInputStream( b1 );
        StatefulKnowledgeSession ksession2 = marshaller.unmarshall( bais,
                                                                    new SessionConfiguration(),
                                                                    EnvironmentFactory.newEnvironment() );
        bais.close();

        bos = new ByteArrayOutputStream();
        marshaller.marshall( bos,
                             ksession2 );
        final byte[] b2 = bos.toByteArray();
View Full Code Here

        byte[] b1 = baos.toByteArray();
        session.halt();
        session.dispose();
        Thread.sleep(400);
       
        ByteArrayInputStream bais = new ByteArrayInputStream( b1 );       
        final StatefulSession session2 = ( StatefulSession ) (( StatefulKnowledgeSessionImpl) marshaller.unmarshall( bais ) ).session;
       
    new Thread(new Runnable() {
      public void run() {
            session2.fireUntilHalt();        
View Full Code Here

TOP

Related Classes of java.io.ByteArrayInputStream

Copyright © 2015 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.