Is it possible to find instances of // in a line read from a file into a byte array and then "snip" from // to the end of the line out? I'm trying
FileInputStream fis = new FileInputStream(file);
byte[] buffer = new byte[8 * 1024];
int read;
while ((read = fis.read(buffer)) != -1)
{
for (int i = 0; i < read; i++)
{
if (buffer[i] == '//')
{
buffer = buffer[0:i];
}
}
}
but I'm getting Invalid character constant at if (buffer[i] == '//') on the '//' part. Am I doing something wrong, or is this just not possible?