Package com.googlecode.objectify.annotation

Examples of com.googlecode.objectify.annotation.Serialize.zip()


        // with whatever the annotation says, and if that doesn't work, try the other option.
        try {
          ByteArrayInputStream bais = new ByteArrayInputStream(value.getBytes());

          // Start with the annotation
          boolean unzip = serializeAnno.zip();
          try {
            return readObject(bais, unzip);
          } catch (IOException ex) {  // will be one of ZipException or StreamCorruptedException
            if (log.isLoggable(Level.INFO))
              log.log(Level.INFO, "Error trying to deserialize object using unzip=" + unzip + ", retrying with " + !unzip, ex);
View Full Code Here


      protected Blob saveValue(Object value, boolean index, SaveContext ctx, Path path) throws SkipException {
        try {
          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          OutputStream out = baos;

          if (serializeAnno.zip()) {
            Deflater deflater = new Deflater(serializeAnno.compressionLevel());
            out = new DeflaterOutputStream(out, deflater);
          }

          ObjectOutputStream oos = new ObjectOutputStream(out);
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.