Package org.simpleframework.util.buffer

Examples of org.simpleframework.util.buffer.BufferException


      write(array, 0, array.length);
   }

   public synchronized void write(byte[] array, int off, int size) throws IOException {
      if(closed) {
         throw new BufferException("Queue has been closed");
      }
      if (size + count > buffer.length) {
         expand(count + size);
      }
      int fragment = buffer.length - seek; // from read pos to end
View Full Code Here


            if(closed) {
               return -1;
            }
            wait();
         } catch(Exception e) {
            throw new BufferException("Thread interrupted", e);
         }
      }
      int chunk = Math.min(size, count);
     
      if(chunk > 0) {
View Full Code Here

      return chunk;
   }  
  
   private synchronized void expand(int capacity) throws IOException {
      if (capacity > limit) {
         throw new BufferException("Capacity limit %s exceeded", limit);
      }
      int resize = buffer.length * 2;
      int size = Math.max(capacity, resize);
      byte[] temp = new byte[size];

View Full Code Here

      seek = 0;
   }
  
   public synchronized void reset() throws IOException {
      if(closed) {
         throw new BufferException("Queue has been closed");
      }
      seek = 0;
      count = 0;
   }
View Full Code Here

TOP

Related Classes of org.simpleframework.util.buffer.BufferException

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.