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