Package java.io

Examples of java.io.ByteArrayOutputStream.toByteArray()


       
        message.write( data, 0, len );
       
        if ( expected_length == -1 && message.size() >= 4 ){
         
          byte[]  bytes = message.toByteArray();
         
          ByteBuffer  bb = ByteBuffer.wrap( bytes );
         
          expected_length = bb.getInt();
         
View Full Code Here


         
          break;
        }
      }
     
      Map map = BDecoder.decode( message.toByteArray() );
      int reply_result = ((Long)map.get( "result" )).intValue();
     
      switch( reply_result ) {
        case 0 :{
          byte[] reason = (byte[])map.get( "reason" );
View Full Code Here

 
              // if we've got some kind of response then return it
           
          if ( message.size() > 0 ){
           
            return( message.toByteArray());
          }
           
          if ( failure_reason == null ){
           
            failure_reason = "No data received from tracker";
View Full Code Here

       
        gzos.write( reply_bytes );
       
        gzos.finish();
       
        reply_bytes = temp.toByteArray();
       
        do_gzip = false;
      }
    }
   
View Full Code Here

       
        oos.writeObject( obj );
       
        oos.close();
       
        res = baos.toByteArray();
       
      }catch( Throwable e ){
       
        throw( new DistributedDatabaseException( "encoding fails", e ));
      }
View Full Code Here

          }
        }
       
        if ( output != null ){
         
          signature = output.toByteArray();
        }
      }
           
      if ( signature == null ){
               
View Full Code Here

           
      try{
       
        out = new FileOutputStream( plistFile );

          out.writebaos.toByteArray() );
 
      }finally{
       
        if( out != null ){
         
View Full Code Here

      ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
      MarshalledValueOutputStream os = new MarshalledValueOutputStream(baos);
      cache.getMarshaller().objectToObjectStream(DefaultStateTransferManager.STREAMING_DELIMITER_NODE, os);
      os.close();

      ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
      MarshalledValueInputStream is = new MarshalledValueInputStream(bais);
      loader.storeEntireState(is);
      is.close();

      Object txnKey = new Object();
View Full Code Here

      catch (IllegalArgumentException expected)
      {
      }

      /* Commit and rollback after rollback. */
      bais = new ByteArrayInputStream(baos.toByteArray());
      is = new MarshalledValueInputStream(bais);
      loader.storeEntireState(is);
      is.close();
      txnKey = new Object();
      loader.prepare(txnKey, mods, false);
View Full Code Here

      MarshalledValueOutputStream os = new MarshalledValueOutputStream(baos);
      loader.loadEntireState(os);
      cache.getMarshaller().objectToObjectStream(DefaultStateTransferManager.STREAMING_DELIMITER_NODE, os);
      os.close();

      ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
      MarshalledValueInputStream is = new MarshalledValueInputStream(bais);
      loader.storeEntireState(is);
      is.close();

      baos = new ByteArrayOutputStream(1024);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.