zero copy in Java and C