php-byte-buffer icon indicating copy to clipboard operation
php-byte-buffer copied to clipboard

Implementing Java's ByteBuffer.allocate

Open Brhsoftco opened this issue 3 years ago • 1 comments

I am porting a Java program which utilises a UTF-8 string conversion to a byte array. It then allocates a byte buffer with a fixed value of 16, before writing each UTF-8 integer representation into the buffer.

How could I reimplement this using this library? It seems the function call to allocate() is missing...

Brhsoftco avatar Jul 07 '22 12:07 Brhsoftco

@Brhsoftco You don't need to allocate memory in PHP. This will be done automatically.

Ne-Lexa avatar Oct 03 '22 13:10 Ne-Lexa