Package jdbm

Examples of jdbm.SerializerOutput


        checkIfClosed();
      if(bufferInUse){
        //current reusable buffer is in use, have to fallback into creating new instances
        byte[] buffer = new byte[1024];
        OpenByteArrayOutputStream bao = new OpenByteArrayOutputStream(buffer);
        SerializerOutput out = new SerializerOutput(bao);
        return insert2(obj,serializer,buffer,bao,out);
      }

        try{
           
View Full Code Here


        }
      if(bufferInUse){
        //current reusable buffer is in use, have to create new instances
        byte[] buffer = new byte[1024];
        OpenByteArrayOutputStream bao = new OpenByteArrayOutputStream(buffer);
        SerializerOutput out = new SerializerOutput(bao);
        update2(recid,obj,serializer,buffer,bao,out);
        return;
      }

        try{       
View Full Code Here

       
      if(bufferInUse){
        //current reusable buffer is in use, have to create new instances
        byte[] buffer = new byte[1024];
        OpenByteArrayOutputStream bao = new OpenByteArrayOutputStream(buffer);
        SerializerOutput out = new SerializerOutput(bao);
        OpenByteArrayInputStream bai = new OpenByteArrayInputStream(buffer);
        SerializerInput in = new SerializerInput(bai);
        return fetch2(recid,serializer,buffer,bao,out, bai,in);
      }
        try{
View Full Code Here

        if(tree.keySerializer!=null){
            for(int i = 0;i<_keys.size();i++){
                if(keys.get(i)==nullcontinue;
                //transform to byte array
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                tree.keySerializer.serialize(new SerializerOutput(baos), (K) keys.get(i));
                keys.set(i, baos.toByteArray());

            }

        }
        Serialization.writeObject(out, keys);

        //write values
        for(int i = 0;i<_keys.size();i++){
          if(_keys.get(i) == null)
            continue;
            if(tree.valueSerializer==null)
              Serialization.writeObject(out, _values.get(i));
            else{
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
            tree.valueSerializer.serialize(new SerializerOutput(baos), _values.get(i));
            BPage.writeByteArray(out, baos.toByteArray());
            }
        }
       
    }
View Full Code Here

      Serialization.writeObject(oos, vals2);
    }else{
      for ( int i=bpage._first; i<_btree._pageSize; i++ ) {                                               
            if ( bpage._values[ i ] != null ) {
              ByteArrayOutputStream baos = new ByteArrayOutputStream();
                _btree.valueSerializer.serialize(new SerializerOutput(baos), bpage._values[ i ] );
                writeByteArray( oos, baos.toByteArray() );
            } else {
                writeByteArray( oos, null );
            }
        }
View Full Code Here

   
    Serializer ser = _btree.keySerializer;
    byte[] previous = null;
    byte[] buffer = new byte[1024];
    OpenByteArrayOutputStream out2 = new OpenByteArrayOutputStream(buffer);
    SerializerOutput out3 = new SerializerOutput(out2);
    for (int i = firstUse ; i < _btree._pageSize; i++) {
      if(keys[i] == null){
        LeadingValueCompressionProvider.writeByteArray(oos, null, previous, 0);
      }else{
        out2.reset();
View Full Code Here

TOP

Related Classes of jdbm.SerializerOutput

Copyright © 2018 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.