List of usage examples for org.apache.wicket.util.io ByteCountingOutputStream ByteCountingOutputStream
ByteCountingOutputStream
From source file:com.quangphuong.crawler.util.Agent.java
public static long sizeOf(Serializable object) { if (object == null) { return 0; }// w ww. j a va 2 s .c om try { final ByteCountingOutputStream out = new ByteCountingOutputStream(); new ObjectOutputStream(out).writeObject(object); out.close(); return out.size(); } catch (IOException e) { return -1; } }