/** * Read a control extension. * Return the extension block data. */ byte[] readExtension() { int extensionID = readID(); if (extensionID == GIF_COMMENT_BLOCK_ID) return readCommentExtension(); if (extensionID == GIF_PLAIN_TEXT_BLOCK_ID) return readPlainTextExtension(); if (extensionID == GIF_GRAPHICS_CONTROL_BLOCK_ID) return readGraphicsControlExtension(); if (extensionID == GIF_APPLICATION_EXTENSION_BLOCK_ID) return readApplicationExtension(); // Otherwise, we don't recognize the block. If the // field size is correct, we can just skip over // the block contents. try { int extSize = inputStream.read(); if (extSize < 0) { SWT.error(SWT.ERROR_INVALID_IMAGE); } byte[] ext = new byte[extSize]; inputStream.read(ext, 0, extSize); return ext; } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); return null; } }
/** * Read a control extension. * Return the extension block data. */ byte[] readExtension() { int extensionID = readID(); if (extensionID == GIF_COMMENT_BLOCK_ID) return readCommentExtension(); if (extensionID == GIF_PLAIN_TEXT_BLOCK_ID) return readPlainTextExtension(); if (extensionID == GIF_GRAPHICS_CONTROL_BLOCK_ID) return readGraphicsControlExtension(); if (extensionID == GIF_APPLICATION_EXTENSION_BLOCK_ID) return readApplicationExtension(); // Otherwise, we don't recognize the block. If the // field size is correct, we can just skip over // the block contents. try { int extSize = inputStream.read(); if (extSize < 0) { SWT.error(SWT.ERROR_INVALID_IMAGE); } byte[] ext = new byte[extSize]; inputStream.read(ext, 0, extSize); return ext; } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); return null; } }
/** * Read a control extension. * Return the extension block data. */ byte[] readExtension() { int extensionID = readID(); if (extensionID == GIF_COMMENT_BLOCK_ID) return readCommentExtension(); if (extensionID == GIF_PLAIN_TEXT_BLOCK_ID) return readPlainTextExtension(); if (extensionID == GIF_GRAPHICS_CONTROL_BLOCK_ID) return readGraphicsControlExtension(); if (extensionID == GIF_APPLICATION_EXTENSION_BLOCK_ID) return readApplicationExtension(); // Otherwise, we don't recognize the block. If the // field size is correct, we can just skip over // the block contents. try { int extSize = inputStream.read(); if (extSize < 0) { SWT.error(SWT.ERROR_INVALID_IMAGE); } byte[] ext = new byte[extSize]; inputStream.read(ext, 0, extSize); return ext; } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); return null; } }
/** * Read a control extension. * Return the extension block data. */ byte[] readExtension() { int extensionID = readID(); if (extensionID == GIF_COMMENT_BLOCK_ID) return readCommentExtension(); if (extensionID == GIF_PLAIN_TEXT_BLOCK_ID) return readPlainTextExtension(); if (extensionID == GIF_GRAPHICS_CONTROL_BLOCK_ID) return readGraphicsControlExtension(); if (extensionID == GIF_APPLICATION_EXTENSION_BLOCK_ID) return readApplicationExtension(); // Otherwise, we don't recognize the block. If the // field size is correct, we can just skip over // the block contents. try { int extSize = inputStream.read(); if (extSize < 0) { SWT.error(SWT.ERROR_INVALID_IMAGE); } byte[] ext = new byte[extSize]; inputStream.read(ext, 0, extSize); return ext; } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); return null; } }
/** * Read a control extension. * Return the extension block data. */ byte[] readExtension() { int extensionID = readID(); if (extensionID == GIF_COMMENT_BLOCK_ID) return readCommentExtension(); if (extensionID == GIF_PLAIN_TEXT_BLOCK_ID) return readPlainTextExtension(); if (extensionID == GIF_GRAPHICS_CONTROL_BLOCK_ID) return readGraphicsControlExtension(); if (extensionID == GIF_APPLICATION_EXTENSION_BLOCK_ID) return readApplicationExtension(); // Otherwise, we don't recognize the block. If the // field size is correct, we can just skip over // the block contents. try { int extSize = inputStream.read(); if (extSize < 0) { SWT.error(SWT.ERROR_INVALID_IMAGE); } byte[] ext = new byte[extSize]; inputStream.read(ext, 0, extSize); return ext; } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); return null; } }
/** * Read a control extension. * Return the extension block data. */ byte[] readExtension() { int extensionID = readID(); if (extensionID == GIF_COMMENT_BLOCK_ID) return readCommentExtension(); if (extensionID == GIF_PLAIN_TEXT_BLOCK_ID) return readPlainTextExtension(); if (extensionID == GIF_GRAPHICS_CONTROL_BLOCK_ID) return readGraphicsControlExtension(); if (extensionID == GIF_APPLICATION_EXTENSION_BLOCK_ID) return readApplicationExtension(); // Otherwise, we don't recognize the block. If the // field size is correct, we can just skip over // the block contents. try { int extSize = inputStream.read(); if (extSize < 0) { SWT.error(SWT.ERROR_INVALID_IMAGE); } byte[] ext = new byte[extSize]; inputStream.read(ext, 0, extSize); return ext; } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); return null; } }