Package freenet.support.api

Examples of freenet.support.api.Bucket


  /** Get a reader bucket */
  public Bucket getReaderBucket() {
    synchronized(this) {
      if(closed) return null;
      Bucket d = new ReaderBucket();
      if (readers == null)
        readers = new ArrayList<Bucket>(1);
      readers.add(d);
      if(logMINOR)
        Logger.minor(this, "getReaderBucket() returning "+d+" for "+this+" for "+bucket);
View Full Code Here


    return key;
  }

  @Override
  public Bucket createShadow() {
    Bucket newUnderlying = bucket.createShadow();
    if(newUnderlying == null) return null;
    return new PaddedEphemerallyEncryptedBucket(this, newUnderlying);
  }
View Full Code Here

            throw new SSKDecodeException("Data length is less than 2 yet compressed!");
          else
            return BucketTools.makeImmutableBucket(factory, dataOutput, 2, dataLength - 2);
        }

        Bucket b = Key.decompress(compressionAlgorithm >= 0, dataOutput, dataLength, factory, Math.min(MAX_DECOMPRESSED_DATA_LENGTH, maxLength), compressionAlgorithm, true);
        return b;
  }
View Full Code Here


public class BMPFilterTest extends TestCase {
  /** File of size less than 54 bytes */
  public void testTooShortImage() throws IOException {
    Bucket input = resourceToBucket("./bmp/small.bmp");
    filterImage(input, DataFilterException.class);
  }
View Full Code Here

    filterImage(input, DataFilterException.class);
  }

  /** Illegal start word (AB instead of BM) */
  public void testIllegalStartWord() throws IOException {
    Bucket input = resourceToBucket("./bmp/one.bmp");
    filterImage(input, DataFilterException.class);
  }
View Full Code Here

    filterImage(input, DataFilterException.class);
  }

  /** Invalid offset i.e. starting address */
  public void testInvalidOffset() throws IOException {
    Bucket input = resourceToBucket("./bmp/two.bmp");
    filterImage(input, DataFilterException.class);
  }
View Full Code Here

    filterImage(input, DataFilterException.class);
  }

  /** Invalid size of bitmap info header */
  public void testInvalidBitmapInfoHeaderSize() throws IOException {
    Bucket input = resourceToBucket("./bmp/three.bmp");
    filterImage(input, DataFilterException.class);
  }
View Full Code Here

    filterImage(input, DataFilterException.class);
  }

  /** Negative image width */
  public void testNegativeImageWidth() throws IOException {
    Bucket input = resourceToBucket("./bmp/four.bmp");
    filterImage(input, DataFilterException.class);
  }
View Full Code Here

    filterImage(input, DataFilterException.class);
  }

  /** Invalid number of planes */
  public void testInvalidNumberOfPlanes() throws IOException {
    Bucket input = resourceToBucket("./bmp/five.bmp");
    filterImage(input, DataFilterException.class);
  }
View Full Code Here

    filterImage(input, DataFilterException.class);
  }

  /** Invalid bit depth */
  public void testInvalidBitDepth() throws IOException {
    Bucket input = resourceToBucket("./bmp/six.bmp");
    filterImage(input, DataFilterException.class);
  }
View Full Code Here

TOP

Related Classes of freenet.support.api.Bucket

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.