Related questions
How to garbage collect a direct buffer in Java
I have a memory leak that I have isolated to incorrectly disposed direct byte buffers.
ByteBuffer buff = ByteBuffer.allocateDirect(7777777);
The GC collects the objects that harbor these buffers but does not dispose of the buffer itself. If I instantiate enough …
Java - Convert int to Byte Array of 4 Bytes?
Possible Duplicate:
Convert integer into byte array (Java)
I need to store the length of a buffer, in a byte array 4 bytes large.
Pseudo code:
private byte[] convertLengthToByte(byte[] myBuffer)
{
int length = myBuffer.length;
byte[] byteLength = new byte[4];
//here is …