CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: keang

Search: Search took 0.17 seconds.

  1. Replies
    15
    Views
    20,350

    Re: need Java memcpy() equivalent

    Oh yes so it does. I've not done much with the nio package but from a quick read of the API docs it looks like it should do what you want.
    Or one you've been using for years when the libraries are...
  2. Replies
    15
    Views
    20,350

    Re: need Java memcpy() equivalent

    :eek: Create a ByteArrayInputStream with your reordered byte data and pass this object as the InputStream when creating the DataInputStream object. The DataInputStream will then read the bytes from...
  3. Replies
    15
    Views
    20,350

    Re: need Java memcpy() equivalent

    I guess it depends on the data stream. If all data is sent as pairs of bytes that need to be in reverse order then do as I suggested, however if the number of bytes and their order depends on the...
  4. Replies
    15
    Views
    20,350

    Re: need Java memcpy() equivalent

    Two things you need to get hold of (you may already have them depending on which jdk pack you downloaded):

    1. Java API docs. These holds details of every public and protected class, method,...
  5. Replies
    15
    Views
    20,350

    Re: need Java memcpy() equivalent

    So you have two issues:
    1. Byte Ordering
    2. Primitive formatting

    Byte ordering is easy to handle - If your IED requires byte reordering simply plug your ByteReorderingInputStream class into the...
  6. Replies
    15
    Views
    20,350

    Re: need Java memcpy() equivalent

    No it isn't. You are dealing with primitive types and not objects.

    No, you need to use something like DataInputStream, as I suggested earlier, which will read the byte stream and recreate a...
  7. Replies
    15
    Views
    20,350

    Re: need Java memcpy() equivalent

    I don't think serialization is going to be useful to you. Serialization is for turning objects and their contents into a transmittable stream of data that can, at some future time, be deserialized...
  8. Replies
    15
    Views
    20,350

    Re: need Java memcpy() equivalent

    Have you considered using java.io.DataInputStream and java.io.DataOutputStream to convert byte streams to primitive types and visa versa.
Results 1 to 8 of 8





Click Here to Expand Forum to Full Width

Featured