docs: public static byte[] readMagic(InputStream is) throws IOException {
          byte[] buf = new byte[32];
          int n = 0;
          while(true) {
              int c = is.read();
              if (c < 0) {
                  throw new EOFException("Cannot read magic");
              }
              if (n >= buf.length) {
                  throw new IOException("Cannot read magic");
              }
              if (c == ' ') {
                  buf[n] = (byte) c;
                  ++n;
                  break;
              }
              else if (MAGIC_APHLABET.indexOf(c) >= 0) {
                  buf[n] = (byte) c;
              }
              else {
                  throw new IOException("Invalid magic");
              }
              ++n;
          }
          return Arrays.copyOf(buf, n);
      }