Package util

Examples of util.ByteBuilder


    mbaHeader=new Property("IDAT");
   
    byte[] output = new byte[1024]; //buffer to read from Deflater
   

    ByteBuilder deflated=new ByteBuilder(); //complete deflate-stream
   
    Deflater compresser = new Deflater(Deflater.DEFAULT_COMPRESSION); //deflater-obj
   
    compresser.setInput(imagedata);
    compresser.finish(); //indicate: there is no more input
   
    int compressedDataLength=0;
   
   
    while( compresser.finished()==false ){ //reading loop
      int tmpComprLength = compresser.deflate(output);
     
      //if stop-button is clicked
      if(Thread.currentThread().isInterrupted()){
        return;
      }
     
      deflated.appendArray(
          (tmpComprLength==output.length)
          ?output
          :Arrays.copyOf(output, tmpComprLength));
      //append new data to existing data
     
      compressedDataLength+=tmpComprLength; //total read bytes so far
   
    }
    assert(compresser.getBytesWritten()==compressedDataLength);
   
    mbaDeflatedStream=deflated.getArray();

  }
View Full Code Here


    }
  }

  @Override
  protected byte[] getData() {
    ByteBuilder bb = new ByteBuilder();
    bb.append(miNumFrames);
    bb.append(miNumLoops);
    
    return bb.getArray();
  }
View Full Code Here

  }
 
  @Override
  protected byte[] getData()
  {
    ByteBuilder bb = new ByteBuilder();
    bb.appendArray(mKeyword.getBytes());
    bb.appendSingle(0);
    bb.appendArray(mText.getBytes());
    return bb.getArray();
  }
View Full Code Here

    mbBlendOp=(byte)iblendmethod; 
  }

  @Override
  protected byte[] getData() {
    ByteBuilder bb = new ByteBuilder();
    bb.append(miSequenceNumber);
    bb.append(miWidth);
    bb.append(miHeight);
    bb.append(miX_Offset);
    bb.append(miY_Offset);
    bb.append(msDelayNum);
    bb.append(msDelayDen);
    bb.appendSingle(mbDisposeOp);
    bb.appendSingle(mbBlendOp);
    return bb.getArray();
   
  }
View Full Code Here

    mbaHeader=new Property("IDAT");
   
    byte[] output = new byte[1024]; //buffer to read from Deflater
   

    ByteBuilder deflated=new ByteBuilder(); //complete deflate-stream
   
    Deflater compresser = new Deflater(Deflater.DEFAULT_COMPRESSION); //deflater-obj
   
    compresser.setInput(imagedata);
    compresser.finish(); //indicate: there is no more input
   
    int compressedDataLength=0;
   
   
    while( compresser.finished()==false ){ //reading loop
      int tmpComprLength = compresser.deflate(output);
     
      //if stop-button is clicked
      if(Thread.currentThread().isInterrupted()){
        return;
      }
     
      deflated.appendArray(
          (tmpComprLength==output.length)
          ?output
          :Arrays.copyOf(output, tmpComprLength));
      //append new data to existing data
     
      compressedDataLength+=tmpComprLength; //total read bytes so far
   
    }
    assert(compresser.getBytesWritten()==compressedDataLength);
   
    mbaDeflatedStream=deflated.getArray();

  }
View Full Code Here

    }
  }

  @Override
  protected byte[] getData() {
    ByteBuilder bb = new ByteBuilder();
    bb.append(miNumFrames);
    bb.append(miNumLoops);
    
    return bb.getArray();
  }
View Full Code Here

    mbaHeader=new Property("IDAT");
   
    byte[] output = new byte[1024]; //buffer to read from Deflater
   

    ByteBuilder deflated=new ByteBuilder(); //complete deflate-stream
   
    Deflater compresser = new Deflater(Deflater.DEFAULT_COMPRESSION); //deflater-obj
   
    compresser.setInput(imagedata);
    compresser.finish(); //indicate: there is no more input
   
    int compressedDataLength=0;
   
   
    while( compresser.finished()==false ){ //reading loop
      int tmpComprLength = compresser.deflate(output);
     
      //if stop-button is clicked
      if(Thread.currentThread().isInterrupted()){
        return;
      }
     
      deflated.appendArray(
          (tmpComprLength==output.length)
          ?output
          :Arrays.copyOf(output, tmpComprLength));
      //append new data to existing data
     
      compressedDataLength+=tmpComprLength; //total read bytes so far
   
    }
    assert(compresser.getBytesWritten()==compressedDataLength);
   
    mbaDeflatedStream=deflated.getArray();

  }
View Full Code Here

    mbBlendOp=(byte)iblendmethod; 
  }

  @Override
  protected byte[] getData() {
    ByteBuilder bb = new ByteBuilder();
    bb.append(miSequenceNumber);
    bb.append(miWidth);
    bb.append(miHeight);
    bb.append(miX_Offset);
    bb.append(miY_Offset);
    bb.append(msDelayNum);
    bb.append(msDelayDen);
    bb.appendSingle(mbDisposeOp);
    bb.appendSingle(mbBlendOp);
    return bb.getArray();
   
  }
View Full Code Here

  }
 
  @Override
  protected byte[] getData()
  {
    ByteBuilder bb = new ByteBuilder();
    bb.appendArray(mKeyword.getBytes());
    bb.appendSingle(0);
    bb.appendArray(mText.getBytes());
    return bb.getArray();
  }
View Full Code Here

    mbBlendOp=(byte)iblendmethod; 
  }

  @Override
  protected byte[] getData() {
    ByteBuilder bb = new ByteBuilder();
    bb.append(miSequenceNumber);
    bb.append(miWidth);
    bb.append(miHeight);
    bb.append(miX_Offset);
    bb.append(miY_Offset);
    bb.append(msDelayNum);
    bb.append(msDelayDen);
    bb.appendSingle(mbDisposeOp);
    bb.appendSingle(mbBlendOp);
    return bb.getArray();
   
  }
View Full Code Here

TOP

Related Classes of util.ByteBuilder

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.