Java nio send multiple file with filename

I have seen other answers like

But the problem i am facing is buffering on server side like (file + filecontent + otherfile + otherfilecontent) into single buffer, how could i parse such information without first converting into String and parsing ?

If the buffering issue is solved i can ofcourse send filesize infront of the buffer ! This is my server side code

private static void store(final SocketChannel clientChannel) throws IOException {

ByteBuffer socketBuffer = ByteBuffer.allocate(BUFFER_SIZE);
// "$jwala$" is to check if filename/directory name has arrived
ByteBuffer protocol=ByteBuffer.wrap("$jwala$".getBytes());

byte initialBytes[];
while (clientChannel.read(socketBuffer)>-1) {
    socketBuffer.flip();
    initialBytes = Arrays.copyOf(socketBuffer.array(),protocol.array().length);


   //this holds true only for first file and cause other file to bewritten in same buffer following firstfile

    if(protocol.compareTo(ByteBuffer.wrap(initialBytes))==0) {

    // okay filename/directory name has arrived has arrived make the file/directory
    }


 //write into file      


 socketBuffer.clear();

}

}