Provo a mettere alcune stringhe su CharBuffer
con la funzione CharBuffer.put()
ma il buffer viene lasciato vuoto.CharBuffer.put() non funzionante
il mio codice:
CharBuffer charBuf = CharBuffer.allocate(1000);
for (int i = 0; i < 10; i++)
{
String text = "testing" + i + "\n";
charBuf.put(text);
}
System.out.println(charBuf);
ho cercato di usare con clear()
o rewind()
dopo allocate(1000)
ma questo non ha cambiato il risultato.