List of usage examples for org.apache.wicket.util.io ByteCountingOutputStream size
long size
To view the source code for org.apache.wicket.util.io ByteCountingOutputStream size.
Click Source Link
From source file:com.quangphuong.crawler.util.Agent.java
public static long sizeOf(Serializable object) { if (object == null) { return 0; }//from w ww .ja v a 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; } }