Solved

java equivalent of bcopy and bzero

Posted on 1997-04-04
1
1,272 Views
Last Modified: 2008-03-10
Is there a java equivalent to c++ bcopy and bzero functions?
It not, does anyone have any suggestions on how I should go
about implementing them?

Thanks for your help.
0
Comment
Question by:raihan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
JWBito earned 50 total points
ID: 1219423
Considering that bcopy and bzero allow one to write anywhere on the process address space, we are glad that Java does not provide the equivalent capability.

Whenever you create a new object, Java guarantees that it will have some initial value.  Primitive scalars (int, float and the like) are initialized to zero.  Booleans are false, and object references are null.

If you have a buffer that you need to move around, you might need to resort to System.arraycopy().  I would try to stay at a higher level and take advantage of Object.clone() for bcopy().  If you need to reinitialize something and are thinking of bzero, perhaps you should reconsider and try something similar to StringBuffer.setLength(0).  Of course, not all are allowed to be reinitialized.
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question