Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Using Java ByteArrayOutputStream Objects

  • 22-03-2003 8:58pm
    #1
    Closed Accounts Posts: 741 ✭✭✭


    I have a problem in Java when using java.io.ByteArrayOutputStreams objects. Every time I use the toByteArray() method it seems to substantially increase the ByteArrayOutputStream objects length. Does anyone know why this is and/or how to get around it. Any help would be much appreciated..


Comments

  • Closed Accounts Posts: 110 ✭✭Korg


    Could you paste in a bit of code to show this happening? From the java api source toByteArray() doesn't do that much, maybe it's something else that's having the effect or maybe i'm missing something.

    [PHP]
    From java.io.ByteArrayOutputStream.java

    public synchronized byte toByteArray()[] {
    byte newbuf[] = new byte[count];
    System.arraycopy(buf, 0, newbuf, 0, count);
    return newbuf;
    [/PHP]


Advertisement