< prev index next >

src/java.base/share/classes/sun/security/util/ManifestDigester.java

Print this page




  93                     return true;
  94                 }
  95                 else {
  96                     // start of a new line
  97                     last = i;
  98                     allBlank = true;
  99                 }
 100                 break;
 101             default:
 102                 allBlank = false;
 103                 break;
 104             }
 105             i++;
 106         }
 107         return false;
 108     }
 109 
 110     public ManifestDigester(byte bytes[])
 111     {
 112         rawBytes = bytes;
 113         entries = new HashMap<String, Entry>();
 114 
 115         ByteArrayOutputStream baos = new ByteArrayOutputStream();
 116 
 117         Position pos = new Position();
 118 
 119         if (!findSection(0, pos))
 120             return; // XXX: exception?
 121 
 122         // create an entry for main attributes
 123         entries.put(MF_MAIN_ATTRS,
 124                 new Entry(0, pos.endOfSection + 1, pos.startOfNext, rawBytes));
 125 
 126         int start = pos.startOfNext;
 127         while(findSection(start, pos)) {
 128             int len = pos.endOfFirstLine-start+1;
 129             int sectionLen = pos.endOfSection-start+1;
 130             int sectionLenWithBlank = pos.startOfNext-start;
 131 
 132             if (len > 6) {
 133                 if (isNameAttr(bytes, start)) {




  93                     return true;
  94                 }
  95                 else {
  96                     // start of a new line
  97                     last = i;
  98                     allBlank = true;
  99                 }
 100                 break;
 101             default:
 102                 allBlank = false;
 103                 break;
 104             }
 105             i++;
 106         }
 107         return false;
 108     }
 109 
 110     public ManifestDigester(byte bytes[])
 111     {
 112         rawBytes = bytes;
 113         entries = new HashMap<>();
 114 
 115         ByteArrayOutputStream baos = new ByteArrayOutputStream();
 116 
 117         Position pos = new Position();
 118 
 119         if (!findSection(0, pos))
 120             return; // XXX: exception?
 121 
 122         // create an entry for main attributes
 123         entries.put(MF_MAIN_ATTRS,
 124                 new Entry(0, pos.endOfSection + 1, pos.startOfNext, rawBytes));
 125 
 126         int start = pos.startOfNext;
 127         while(findSection(start, pos)) {
 128             int len = pos.endOfFirstLine-start+1;
 129             int sectionLen = pos.endOfSection-start+1;
 130             int sectionLenWithBlank = pos.startOfNext-start;
 131 
 132             if (len > 6) {
 133                 if (isNameAttr(bytes, start)) {


< prev index next >