Package org.apache.oodt.commons.io

Examples of org.apache.oodt.commons.io.CountingOutputStream


    return new ByteArrayInputStream(baos.toByteArray());
  }

  public long sizeOf(Object obj) {
    try {
      CountingOutputStream c = new CountingOutputStream(new NullOutputStream());
      ObjectOutputStream stream = new ObjectOutputStream(c);
      stream.writeObject(obj);
      stream.close();
      return c.getBytesWritten();
    } catch (IOException ex) {
      throw new IllegalStateException("I/O exception " + ex.getClass().getName() + " can't happen, yet did: "
        + ex.getMessage());
    }
  }
View Full Code Here


    return new ByteArrayInputStream(baos.toByteArray());
  }

  public long sizeOf(Object obj) {
    try {
      CountingOutputStream c = new CountingOutputStream(new NullOutputStream());
      ObjectOutputStream stream = new ObjectOutputStream(c);
      stream.writeObject(obj);
      stream.close();
      return c.getBytesWritten();
    } catch (IOException ex) {
      throw new IllegalStateException("I/O exception " + ex.getClass().getName() + " can't happen, yet did: "
        + ex.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.oodt.commons.io.CountingOutputStream

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.