src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java

Print this page




1087                              VsamplingFactors,
1088                              QtableSelectors,
1089                              haveMetadata,
1090                              restartInterval);
1091 
1092         cbLock.lock();
1093         try {
1094             if (aborted) {
1095                 processWriteAborted();
1096             } else {
1097                 processImageComplete();
1098             }
1099 
1100             ios.flush();
1101         } finally {
1102             cbLock.unlock();
1103         }
1104         currentImage++;  // After a successful write
1105     }
1106 





1107     public void prepareWriteSequence(IIOMetadata streamMetadata)
1108         throws IOException {
1109         setThreadLock();
1110         try {
1111             cbLock.check();
1112 
1113             prepareWriteSequenceOnThread(streamMetadata);
1114         } finally {
1115             clearThreadLock();
1116         }
1117     }
1118 
1119     private void prepareWriteSequenceOnThread(IIOMetadata streamMetadata)
1120         throws IOException {
1121         if (ios == null) {
1122             throw new IllegalStateException("Output has not been set!");
1123         }
1124 
1125         /*
1126          * from jpeg_metadata.html:




1087                              VsamplingFactors,
1088                              QtableSelectors,
1089                              haveMetadata,
1090                              restartInterval);
1091 
1092         cbLock.lock();
1093         try {
1094             if (aborted) {
1095                 processWriteAborted();
1096             } else {
1097                 processImageComplete();
1098             }
1099 
1100             ios.flush();
1101         } finally {
1102             cbLock.unlock();
1103         }
1104         currentImage++;  // After a successful write
1105     }
1106 
1107     @Override
1108     public boolean canWriteSequence() {
1109         return true;
1110     }
1111 
1112     public void prepareWriteSequence(IIOMetadata streamMetadata)
1113         throws IOException {
1114         setThreadLock();
1115         try {
1116             cbLock.check();
1117 
1118             prepareWriteSequenceOnThread(streamMetadata);
1119         } finally {
1120             clearThreadLock();
1121         }
1122     }
1123 
1124     private void prepareWriteSequenceOnThread(IIOMetadata streamMetadata)
1125         throws IOException {
1126         if (ios == null) {
1127             throw new IllegalStateException("Output has not been set!");
1128         }
1129 
1130         /*
1131          * from jpeg_metadata.html: