Update SimpleText.java

This commit is contained in:
Denis Molony 2019-12-07 08:49:34 +10:00
parent 6cc3e64071
commit 504d8f467e

View File

@ -1,16 +1,22 @@
package com.bytezone.diskbrowser.applefile;
// -----------------------------------------------------------------------------------//
public class SimpleText extends AbstractFile
// -----------------------------------------------------------------------------------//
{
// LISA text file
// ---------------------------------------------------------------------------------//
public SimpleText (String name, byte[] buffer)
// ---------------------------------------------------------------------------------//
{
super (name, buffer);
}
// ---------------------------------------------------------------------------------//
@Override
public String getText ()
// ---------------------------------------------------------------------------------//
{
StringBuilder text = new StringBuilder ();
@ -29,7 +35,9 @@ public class SimpleText extends AbstractFile
return text.toString ();
}
// ---------------------------------------------------------------------------------//
private String getLine (int ptr)
// ---------------------------------------------------------------------------------//
{
StringBuilder line = new StringBuilder ();
@ -40,7 +48,9 @@ public class SimpleText extends AbstractFile
return line.toString ();
}
// ---------------------------------------------------------------------------------//
public static boolean isHTML (byte[] buffer)
// ---------------------------------------------------------------------------------//
{
String text = new String (buffer, 0, buffer.length);
if (text.indexOf ("HTML") > 0 || text.indexOf ("html") > 0)